We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8f5ff34 commit 3840c79Copy full SHA for 3840c79
lib/resque/worker.rb
@@ -108,7 +108,7 @@ def work(interval = 5, &block)
108
startup
109
110
loop do
111
- break if @shutdown
+ break if shutdown?
112
113
if not @paused and job = reserve
114
log "got: #{job.inspect}"
@@ -265,6 +265,11 @@ def shutdown!
265
kill_child
266
end
267
268
+ # Should this worker shutdown as soon as current job is finished?
269
+ def shutdown?
270
+ @shutdown
271
+ end
272
+
273
# Kills the forked child immediately, without remorse. The job it
274
# is processing will not be completed.
275
def kill_child
0 commit comments