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
65703064
Commit
65703064
authored
Mar 20, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable the file download scheduler when tracking DB is not available
parent
293f9dae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
app/workers/geo_file_download_dispatch_worker.rb
app/workers/geo_file_download_dispatch_worker.rb
+1
-0
spec/workers/geo_file_download_dispatch_worker_spec.rb
spec/workers/geo_file_download_dispatch_worker_spec.rb
+10
-0
No files found.
app/workers/geo_file_download_dispatch_worker.rb
View file @
65703064
...
@@ -22,6 +22,7 @@ class GeoFileDownloadDispatchWorker
...
@@ -22,6 +22,7 @@ class GeoFileDownloadDispatchWorker
# files, excluding ones in progress.
# files, excluding ones in progress.
# 5. Quit when we have scheduled all downloads or exceeded an hour.
# 5. Quit when we have scheduled all downloads or exceeded an hour.
def
perform
def
perform
return
unless
Gitlab
::
Geo
.
configured?
return
unless
Gitlab
::
Geo
.
secondary?
return
unless
Gitlab
::
Geo
.
secondary?
@start_time
=
Time
.
now
@start_time
=
Time
.
now
...
...
spec/workers/geo_file_download_dispatch_worker_spec.rb
View file @
65703064
...
@@ -13,6 +13,16 @@ describe GeoFileDownloadDispatchWorker do
...
@@ -13,6 +13,16 @@ describe GeoFileDownloadDispatchWorker do
subject
{
described_class
.
new
}
subject
{
described_class
.
new
}
describe
'#perform'
do
describe
'#perform'
do
it
'does not schedule anything when tracking DB is not available'
do
create
(
:lfs_object
,
:with_file
)
allow
(
Rails
.
configuration
).
to
receive
(
:respond_to?
).
with
(
:geo_database
)
{
false
}
expect
(
GeoFileDownloadWorker
).
not_to
receive
(
:perform_async
)
subject
.
perform
end
it
'does not schedule anything when node is disabled'
do
it
'does not schedule anything when node is disabled'
do
create
(
:lfs_object
,
:with_file
)
create
(
:lfs_object
,
:with_file
)
...
...
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