Skip to content

Commit

Permalink
i'm not sure quite how this worked before, but this is clearer, and w…
Browse files Browse the repository at this point in the history
…orks on rbx...
  • Loading branch information
imajes committed May 2, 2012
1 parent f03ba93 commit 4f1f572
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/resque/worker.rb
Expand Up @@ -199,17 +199,17 @@ def reserve(interval = 5.0)
queues.map {|queue| Queue.new(queue, Resque.redis, Resque.coder) },
Resque.redis)

queue, job = if interval < 1
if interval < 1
begin
multi_queue.pop(true)
queue, job = multi_queue.pop(true)
rescue ThreadError
nil
end
else
queue, job = multi_queue.poll(interval.to_i)
end

log! "Found job on #{queue}"
log! "Found job on #{queue.name}"
Job.new(queue.name, job) if queue && job
end

Expand Down

0 comments on commit 4f1f572

Please sign in to comment.