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
b38b6b8f
Commit
b38b6b8f
authored
Mar 16, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable the backfilling mechanism when tracking DB is not available
parent
09a30afd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
app/workers/geo_backfill_worker.rb
app/workers/geo_backfill_worker.rb
+1
-0
spec/workers/geo_backfill_worker_spec.rb
spec/workers/geo_backfill_worker_spec.rb
+16
-0
No files found.
app/workers/geo_backfill_worker.rb
View file @
b38b6b8f
...
...
@@ -6,6 +6,7 @@ class GeoBackfillWorker
BATCH_SIZE
=
100
.
freeze
def
perform
return
unless
Rails
.
configuration
.
respond_to?
(
:geo_database
)
return
unless
Gitlab
::
Geo
.
primary_node
.
present?
start_time
=
Time
.
now
...
...
spec/workers/geo_backfill_worker_spec.rb
View file @
b38b6b8f
...
...
@@ -18,6 +18,22 @@ describe Geo::GeoBackfillWorker, services: true do
subject
.
perform
end
it
'does not perform Geo::RepositoryBackfillService when tracking DB is not available'
do
allow
(
Rails
.
configuration
).
to
receive
(
:respond_to?
).
with
(
:geo_database
)
{
false
}
expect
(
Geo
::
RepositoryBackfillService
).
not_to
receive
(
:new
)
subject
.
perform
end
it
'does not perform Geo::RepositoryBackfillService when primary node does not exists'
do
allow
(
Gitlab
::
Geo
).
to
receive
(
:primary_node
)
{
nil
}
expect
(
Geo
::
RepositoryBackfillService
).
not_to
receive
(
:new
)
subject
.
perform
end
it
'does not perform Geo::RepositoryBackfillService when node is disabled'
do
allow_any_instance_of
(
GeoNode
).
to
receive
(
:enabled?
)
{
false
}
...
...
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