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
6f9e1118
Commit
6f9e1118
authored
Feb 11, 2020
by
Jennie Louie
Committed by
Douglas Barbosa Alexandre
Feb 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add break clause to log cursor event processing
parent
c58c97cc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
ee/lib/gitlab/geo/log_cursor/daemon.rb
ee/lib/gitlab/geo/log_cursor/daemon.rb
+5
-1
ee/spec/lib/gitlab/geo/log_cursor/daemon_spec.rb
ee/spec/lib/gitlab/geo/log_cursor/daemon_spec.rb
+9
-0
No files found.
ee/lib/gitlab/geo/log_cursor/daemon.rb
View file @
6f9e1118
...
...
@@ -48,7 +48,11 @@ module Gitlab
# Wrap this with the connection to make it possible to reconnect if
# PGbouncer dies: https://github.com/rails/rails/issues/29189
ActiveRecord
::
Base
.
connection_pool
.
with_connection
do
LogCursor
::
EventLogs
.
new
.
fetch_in_batches
{
|
batch
,
last_id
|
handle_events
(
batch
,
last_id
)
}
LogCursor
::
EventLogs
.
new
.
fetch_in_batches
do
|
batch
,
last_id
|
break
if
exit
?
handle_events
(
batch
,
last_id
)
end
end
end
...
...
ee/spec/lib/gitlab/geo/log_cursor/daemon_spec.rb
View file @
6f9e1118
...
...
@@ -136,6 +136,15 @@ describe Gitlab::Geo::LogCursor::Daemon, :clean_gitlab_redis_shared_state do
daemon
.
find_and_handle_events!
end
it
'exits when told to stop'
do
allow_any_instance_of
(
::
Gitlab
::
Geo
::
LogCursor
::
EventLogs
).
to
receive
(
:fetch_in_batches
)
allow
(
daemon
).
to
receive
(
:exit?
).
and_return
(
true
)
expect
(
daemon
).
not_to
receive
(
:handle_events
)
daemon
.
find_and_handle_events!
end
end
context
'when node has namespace restrictions'
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