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
8a7efee8
Commit
8a7efee8
authored
Oct 04, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the backoff delay
parent
eb4a4dcc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
lib/gitlab/geo/log_cursor/daemon.rb
lib/gitlab/geo/log_cursor/daemon.rb
+2
-3
spec/lib/gitlab/geo/log_cursor/daemon_spec.rb
spec/lib/gitlab/geo/log_cursor/daemon_spec.rb
+5
-5
No files found.
lib/gitlab/geo/log_cursor/daemon.rb
View file @
8a7efee8
...
...
@@ -5,7 +5,6 @@ module Gitlab
VERSION
=
'0.1.0'
.
freeze
POOL_WAIT
=
5
.
seconds
.
freeze
BATCH_SIZE
=
250
SYNC_BACKOFF_DELAY
=
5
.
minutes
attr_reader
:options
...
...
@@ -122,7 +121,7 @@ module Gitlab
registry
.
save!
::
Geo
::
ProjectSyncWorker
.
perform_
in
(
SYNC_BACKOFF_DELAY
,
event
.
project_id
,
Time
.
now
)
::
Geo
::
ProjectSyncWorker
.
perform_
async
(
event
.
project_id
,
Time
.
now
)
end
def
handle_repository_updated
(
event_log
)
...
...
@@ -139,7 +138,7 @@ module Gitlab
registry
.
save!
::
Geo
::
ProjectSyncWorker
.
perform_
in
(
SYNC_BACKOFF_DELAY
,
event
.
project_id
,
Time
.
now
)
::
Geo
::
ProjectSyncWorker
.
perform_
async
(
event
.
project_id
,
Time
.
now
)
end
def
handle_repository_deleted
(
event_log
)
...
...
spec/lib/gitlab/geo/log_cursor/daemon_spec.rb
View file @
8a7efee8
...
...
@@ -62,8 +62,8 @@ describe Gitlab::Geo::LogCursor::Daemon, :postgresql do
end
it
'performs Geo::ProjectSyncWorker'
do
expect
(
Geo
::
ProjectSyncWorker
).
to
receive
(
:perform_
in
)
.
with
(
anything
,
project
.
id
,
anything
).
once
.
and_return
(
spy
)
expect
(
Geo
::
ProjectSyncWorker
).
to
receive
(
:perform_
async
)
.
with
(
project
.
id
,
anything
).
once
.
and_return
(
spy
)
subject
.
run!
end
...
...
@@ -102,8 +102,8 @@ describe Gitlab::Geo::LogCursor::Daemon, :postgresql do
end
it
'performs Geo::ProjectSyncWorker'
do
expect
(
Geo
::
ProjectSyncWorker
).
to
receive
(
:perform_
in
)
.
with
(
anything
,
project
.
id
,
anything
).
once
.
and_return
(
spy
)
expect
(
Geo
::
ProjectSyncWorker
).
to
receive
(
:perform_
async
)
.
with
(
project
.
id
,
anything
).
once
.
and_return
(
spy
)
subject
.
run!
end
...
...
@@ -171,7 +171,7 @@ describe Gitlab::Geo::LogCursor::Daemon, :postgresql do
before
do
allow
(
subject
).
to
receive
(
:exit?
).
and_return
(
false
,
true
)
allow
(
Geo
::
ProjectSyncWorker
).
to
receive
(
:perform_
in
).
and_return
(
spy
)
allow
(
Geo
::
ProjectSyncWorker
).
to
receive
(
:perform_
async
).
and_return
(
spy
)
end
it
'replays events for projects that belong to selected namespaces to replicate'
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