Skip to content

Commit

Permalink
Worker#unregister_worker shouldn't call done_working
Browse files Browse the repository at this point in the history
unregister_worker faulty increments Stat[:processed] by calling done_working
  • Loading branch information
ctrochalakis authored and defunkt committed Feb 9, 2010
1 parent 565e076 commit 66f7813
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lib/resque/worker.rb
Expand Up @@ -312,8 +312,6 @@ def register_worker

# Unregisters ourself as a worker. Useful when shutting down.
def unregister_worker
done_working

redis.srem(:workers, self)
redis.del("worker:#{self}:started")

Expand Down
5 changes: 5 additions & 0 deletions test/worker_test.rb
Expand Up @@ -226,4 +226,9 @@
assert_equal 1, Resque.workers.size
end
end

test "Processed jobs count" do
@worker.work(0)
assert_equal 1, Resque.info[:processed]
end
end

0 comments on commit 66f7813

Please sign in to comment.