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
d8487777
Commit
d8487777
authored
Apr 28, 2017
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address review comments for Geo spec
parent
9c03ebd6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
lib/gitlab/geo.rb
lib/gitlab/geo.rb
+6
-6
spec/lib/gitlab/geo_spec.rb
spec/lib/gitlab/geo_spec.rb
+9
-9
No files found.
lib/gitlab/geo.rb
View file @
d8487777
...
@@ -83,18 +83,18 @@ module Gitlab
...
@@ -83,18 +83,18 @@ module Gitlab
end
end
def
self
.
configure_primary_jobs!
def
self
.
configure_primary_jobs!
PRIMARY_JOBS
.
map
{
|
job
|
self
.
send
(
job
).
try
(
:enable!
)
}
PRIMARY_JOBS
.
each
{
|
job
|
self
.
send
(
job
).
try
(
:enable!
)
}
SECONDARY_JOBS
.
map
{
|
job
|
self
.
send
(
job
).
try
(
:disable!
)
}
SECONDARY_JOBS
.
each
{
|
job
|
self
.
send
(
job
).
try
(
:disable!
)
}
end
end
def
self
.
configure_secondary_jobs!
def
self
.
configure_secondary_jobs!
PRIMARY_JOBS
.
map
{
|
job
|
self
.
send
(
job
).
try
(
:disable!
)
}
PRIMARY_JOBS
.
each
{
|
job
|
self
.
send
(
job
).
try
(
:disable!
)
}
SECONDARY_JOBS
.
map
{
|
job
|
self
.
send
(
job
).
try
(
:enable!
)
}
SECONDARY_JOBS
.
each
{
|
job
|
self
.
send
(
job
).
try
(
:enable!
)
}
end
end
def
self
.
disable_all_jobs!
def
self
.
disable_all_jobs!
PRIMARY_JOBS
.
map
{
|
job
|
self
.
send
(
job
).
try
(
:disable!
)
}
PRIMARY_JOBS
.
each
{
|
job
|
self
.
send
(
job
).
try
(
:disable!
)
}
SECONDARY_JOBS
.
map
{
|
job
|
self
.
send
(
job
).
try
(
:disable!
)
}
SECONDARY_JOBS
.
each
{
|
job
|
self
.
send
(
job
).
try
(
:disable!
)
}
end
end
def
self
.
configure_cron_jobs!
def
self
.
configure_cron_jobs!
...
...
spec/lib/gitlab/geo_spec.rb
View file @
d8487777
...
@@ -133,26 +133,26 @@ describe Gitlab::Geo, lib: true do
...
@@ -133,26 +133,26 @@ describe Gitlab::Geo, lib: true do
allow
(
described_class
).
to
receive
(
:primary?
).
and_return
(
true
)
allow
(
described_class
).
to
receive
(
:primary?
).
and_return
(
true
)
described_class
.
configure_cron_jobs!
described_class
.
configure_cron_jobs!
expect
(
described_class
.
bulk_notify_job
.
enabled?
).
to
be_truthy
expect
(
described_class
.
bulk_notify_job
).
to
be_enabled
expect
(
described_class
.
backfill_job
.
enabled?
).
to
be_falsey
expect
(
described_class
.
backfill_job
).
not_to
be_enabled
expect
(
described_class
.
file_download_job
.
enabled?
).
to
be_falsey
expect
(
described_class
.
file_download_job
).
not_to
be_enabled
end
end
it
'activates cron jobs for secondary'
do
it
'activates cron jobs for secondary'
do
allow
(
described_class
).
to
receive
(
:secondary?
).
and_return
(
true
)
allow
(
described_class
).
to
receive
(
:secondary?
).
and_return
(
true
)
described_class
.
configure_cron_jobs!
described_class
.
configure_cron_jobs!
expect
(
described_class
.
bulk_notify_job
.
enabled?
).
to
be_falsey
expect
(
described_class
.
bulk_notify_job
).
not_to
be_enabled
expect
(
described_class
.
backfill_job
.
enabled?
).
to
be_truthy
expect
(
described_class
.
backfill_job
).
to
be_enabled
expect
(
described_class
.
file_download_job
.
enabled?
).
to
be_truthy
expect
(
described_class
.
file_download_job
).
to
be_enabled
end
end
it
'deactivates all jobs when Geo is not active'
do
it
'deactivates all jobs when Geo is not active'
do
described_class
.
configure_cron_jobs!
described_class
.
configure_cron_jobs!
expect
(
described_class
.
bulk_notify_job
.
enabled?
).
to
be_falsey
expect
(
described_class
.
bulk_notify_job
).
not_to
be_enabled
expect
(
described_class
.
backfill_job
.
enabled?
).
to
be_falsey
expect
(
described_class
.
backfill_job
).
not_to
be_enabled
expect
(
described_class
.
file_download_job
.
enabled?
).
to
be_falsey
expect
(
described_class
.
file_download_job
).
not_to
be_enabled
end
end
end
end
end
end
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