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
f6f2024a
Commit
f6f2024a
authored
Nov 18, 2020
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure that reenqueuer always returns the original value
parent
b5afee0a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
app/workers/concerns/reenqueuer.rb
app/workers/concerns/reenqueuer.rb
+5
-1
spec/workers/concerns/reenqueuer_spec.rb
spec/workers/concerns/reenqueuer_spec.rb
+8
-0
No files found.
app/workers/concerns/reenqueuer.rb
View file @
f6f2024a
...
...
@@ -52,7 +52,11 @@ module Reenqueuer
private
def
reenqueue
(
*
args
)
self
.
class
.
perform_async
(
*
args
)
if
yield
result
=
yield
self
.
class
.
perform_async
(
*
args
)
if
result
result
end
# Override as needed
...
...
spec/workers/concerns/reenqueuer_spec.rb
View file @
f6f2024a
...
...
@@ -79,6 +79,10 @@ RSpec.describe Reenqueuer do
job
.
perform
end
it
'returns the original value from #perform'
do
expect
(
job
.
perform
).
to
eq
(
true
)
end
end
context
'when #perform returns falsey'
do
...
...
@@ -87,6 +91,10 @@ RSpec.describe Reenqueuer do
job
.
perform
end
it
'returns the original value from #perform'
do
expect
(
job
.
perform
).
to
eq
(
false
)
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