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
dbd88c02
Commit
dbd88c02
authored
Aug 21, 2019
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Put cancelled job in DeadSet
This replicates Sidekiq behavior of pushing dead job into DeadSet.
parent
8d17c4da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
lib/gitlab/sidekiq_middleware/monitor.rb
lib/gitlab/sidekiq_middleware/monitor.rb
+5
-1
spec/lib/gitlab/sidekiq_middleware/monitor_spec.rb
spec/lib/gitlab/sidekiq_middleware/monitor_spec.rb
+9
-1
No files found.
lib/gitlab/sidekiq_middleware/monitor.rb
View file @
dbd88c02
...
...
@@ -8,8 +8,12 @@ module Gitlab
yield
end
rescue
Gitlab
::
SidekiqMonitor
::
CancelledError
# push job to DeadSet
payload
=
::
Sidekiq
.
dump_json
(
job
)
::
Sidekiq
::
DeadSet
.
new
.
kill
(
payload
,
notify_failure:
false
)
# ignore retries
raise
Sidekiq
::
JobRetry
::
Skip
raise
::
Sidekiq
::
JobRetry
::
Skip
end
end
end
...
...
spec/lib/gitlab/sidekiq_middleware/monitor_spec.rb
View file @
dbd88c02
...
...
@@ -33,9 +33,17 @@ describe Gitlab::SidekiqMiddleware::Monitor do
end
end
it
'
does skip this
job'
do
it
'
skips the
job'
do
expect
{
subject
}.
to
raise_error
(
Sidekiq
::
JobRetry
::
Skip
)
end
it
'puts job in DeadSet'
do
::
Sidekiq
::
DeadSet
.
new
.
clear
expect
do
subject
rescue
Sidekiq
::
JobRetry
::
Skip
end
.
to
change
{
::
Sidekiq
::
DeadSet
.
new
.
size
}.
by
(
1
)
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