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
...
@@ -5,7 +5,6 @@ module Gitlab
VERSION
=
'0.1.0'
.
freeze
VERSION
=
'0.1.0'
.
freeze
POOL_WAIT
=
5
.
seconds
.
freeze
POOL_WAIT
=
5
.
seconds
.
freeze
BATCH_SIZE
=
250
BATCH_SIZE
=
250
SYNC_BACKOFF_DELAY
=
5
.
minutes
attr_reader
:options
attr_reader
:options
...
@@ -122,7 +121,7 @@ module Gitlab
...
@@ -122,7 +121,7 @@ module Gitlab
registry
.
save!
registry
.
save!
::
Geo
::
ProjectSyncWorker
.
perform_
in
(
SYNC_BACKOFF_DELAY
,
event
.
project_id
,
Time
.
now
)
::
Geo
::
ProjectSyncWorker
.
perform_
async
(
event
.
project_id
,
Time
.
now
)
end
end
def
handle_repository_updated
(
event_log
)
def
handle_repository_updated
(
event_log
)
...
@@ -139,7 +138,7 @@ module Gitlab
...
@@ -139,7 +138,7 @@ module Gitlab
registry
.
save!
registry
.
save!
::
Geo
::
ProjectSyncWorker
.
perform_
in
(
SYNC_BACKOFF_DELAY
,
event
.
project_id
,
Time
.
now
)
::
Geo
::
ProjectSyncWorker
.
perform_
async
(
event
.
project_id
,
Time
.
now
)
end
end
def
handle_repository_deleted
(
event_log
)
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
...
@@ -62,8 +62,8 @@ describe Gitlab::Geo::LogCursor::Daemon, :postgresql do
end
end
it
'performs Geo::ProjectSyncWorker'
do
it
'performs Geo::ProjectSyncWorker'
do
expect
(
Geo
::
ProjectSyncWorker
).
to
receive
(
:perform_
in
)
expect
(
Geo
::
ProjectSyncWorker
).
to
receive
(
:perform_
async
)
.
with
(
anything
,
project
.
id
,
anything
).
once
.
and_return
(
spy
)
.
with
(
project
.
id
,
anything
).
once
.
and_return
(
spy
)
subject
.
run!
subject
.
run!
end
end
...
@@ -102,8 +102,8 @@ describe Gitlab::Geo::LogCursor::Daemon, :postgresql do
...
@@ -102,8 +102,8 @@ describe Gitlab::Geo::LogCursor::Daemon, :postgresql do
end
end
it
'performs Geo::ProjectSyncWorker'
do
it
'performs Geo::ProjectSyncWorker'
do
expect
(
Geo
::
ProjectSyncWorker
).
to
receive
(
:perform_
in
)
expect
(
Geo
::
ProjectSyncWorker
).
to
receive
(
:perform_
async
)
.
with
(
anything
,
project
.
id
,
anything
).
once
.
and_return
(
spy
)
.
with
(
project
.
id
,
anything
).
once
.
and_return
(
spy
)
subject
.
run!
subject
.
run!
end
end
...
@@ -171,7 +171,7 @@ describe Gitlab::Geo::LogCursor::Daemon, :postgresql do
...
@@ -171,7 +171,7 @@ describe Gitlab::Geo::LogCursor::Daemon, :postgresql do
before
do
before
do
allow
(
subject
).
to
receive
(
:exit?
).
and_return
(
false
,
true
)
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
end
it
'replays events for projects that belong to selected namespaces to replicate'
do
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