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
6bba487b
Commit
6bba487b
authored
Mar 30, 2018
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix "Geo: PagesDomainVerificationWorker can start up on secondaries if DB is down"
parent
0c16b08b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
ee/lib/gitlab/geo/cron_manager.rb
ee/lib/gitlab/geo/cron_manager.rb
+4
-2
ee/spec/lib/gitlab/geo/cron_manager_spec.rb
ee/spec/lib/gitlab/geo/cron_manager_spec.rb
+12
-0
No files found.
ee/lib/gitlab/geo/cron_manager.rb
View file @
6bba487b
...
@@ -21,9 +21,11 @@ module Gitlab
...
@@ -21,9 +21,11 @@ module Gitlab
CONFIG_WATCHER_CLASS
=
'Geo::SidekiqCronConfigWorker'
.
freeze
CONFIG_WATCHER_CLASS
=
'Geo::SidekiqCronConfigWorker'
.
freeze
def
execute
def
execute
if
Geo
.
connected?
&&
Geo
.
primary?
return
unless
Geo
.
connected?
if
Geo
.
primary?
configure_primary
configure_primary
elsif
Geo
.
connected?
&&
Geo
.
secondary?
elsif
Geo
.
secondary?
configure_secondary
configure_secondary
else
else
enable!
(
all_jobs
(
except:
GEO_JOBS
))
enable!
(
all_jobs
(
except:
GEO_JOBS
))
...
...
ee/spec/lib/gitlab/geo/cron_manager_spec.rb
View file @
6bba487b
...
@@ -23,6 +23,10 @@ describe Gitlab::Geo::CronManager, :geo do
...
@@ -23,6 +23,10 @@ describe Gitlab::Geo::CronManager, :geo do
job
.
enable!
job
.
enable!
end
end
def
count_enabled
JOBS
.
count
{
|
job_name
|
job
(
job_name
).
enabled?
}
end
JOBS
=
%w[
JOBS
=
%w[
ldap_test
ldap_test
geo_repository_verification_primary_batch_worker
geo_repository_verification_primary_batch_worker
...
@@ -77,6 +81,14 @@ describe Gitlab::Geo::CronManager, :geo do
...
@@ -77,6 +81,14 @@ describe Gitlab::Geo::CronManager, :geo do
it
'enables non-geo jobs'
do
it
'enables non-geo jobs'
do
expect
(
ldap_test_job
).
to
be_enabled
expect
(
ldap_test_job
).
to
be_enabled
end
end
context
'No connection'
do
it
'does not change current job configuration'
do
allow
(
Geo
).
to
receive
(
:connected?
).
and_return
(
false
)
expect
{
manager
.
execute
}.
not_to
change
{
count_enabled
}
end
end
end
end
context
'on a Geo secondary'
do
context
'on a Geo secondary'
do
...
...
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