Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
938ac070
Commit
938ac070
authored
Mar 29, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle the Gitlab::Shell::Error on Geo repository fetch worker
parent
cf91b76a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
app/workers/geo_repository_fetch_worker.rb
app/workers/geo_repository_fetch_worker.rb
+3
-0
spec/workers/geo_repository_fetch_worker_spec.rb
spec/workers/geo_repository_fetch_worker_spec.rb
+6
-0
No files found.
app/workers/geo_repository_fetch_worker.rb
View file @
938ac070
class
GeoRepositoryFetchWorker
class
GeoRepositoryFetchWorker
include
Sidekiq
::
Worker
include
Sidekiq
::
Worker
include
Gitlab
::
ShellAdapter
include
Gitlab
::
ShellAdapter
sidekiq_options
queue:
'geo_repository_update'
sidekiq_options
queue:
'geo_repository_update'
def
perform
(
project_id
,
clone_url
)
def
perform
(
project_id
,
clone_url
)
...
@@ -12,5 +13,7 @@ class GeoRepositoryFetchWorker
...
@@ -12,5 +13,7 @@ class GeoRepositoryFetchWorker
project
.
repository
.
expire_all_method_caches
project
.
repository
.
expire_all_method_caches
project
.
repository
.
expire_branch_cache
project
.
repository
.
expire_branch_cache
project
.
repository
.
expire_content_cache
project
.
repository
.
expire_content_cache
rescue
Gitlab
::
Shell
::
Error
=>
e
logger
.
error
"Error fetching repository for project
#{
project
.
path_with_namespace
}
:
#{
e
}
"
end
end
end
end
spec/workers/geo_repository_fetch_worker_spec.rb
View file @
938ac070
...
@@ -40,6 +40,12 @@ describe GeoRepositoryFetchWorker do
...
@@ -40,6 +40,12 @@ describe GeoRepositoryFetchWorker do
perform
perform
end
end
it
'does not raise exception when git failures occurs'
do
expect_any_instance_of
(
Repository
).
to
receive
(
:fetch_geo_mirror
).
and_raise
(
Gitlab
::
Shell
::
Error
)
expect
{
perform
}.
not_to
raise_error
end
end
end
def
perform
def
perform
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment