Skip to content

Commit 66f7813

Browse files
ctrochalakisdefunkt
authored andcommitted
Worker#unregister_worker shouldn't call done_working
unregister_worker faulty increments Stat[:processed] by calling done_working
1 parent 565e076 commit 66f7813

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/resque/worker.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,6 @@ def register_worker
312312

313313
# Unregisters ourself as a worker. Useful when shutting down.
314314
def unregister_worker
315-
done_working
316-
317315
redis.srem(:workers, self)
318316
redis.del("worker:#{self}:started")
319317

test/worker_test.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,4 +226,9 @@
226226
assert_equal 1, Resque.workers.size
227227
end
228228
end
229+
230+
test "Processed jobs count" do
231+
@worker.work(0)
232+
assert_equal 1, Resque.info[:processed]
233+
end
229234
end

0 commit comments

Comments
 (0)