lib/beanstalk-client-rspec.rb in beanstalk-client-rspec-0.0.4 vs lib/beanstalk-client-rspec.rb in beanstalk-client-rspec-0.0.5
- old
+ new
@@ -27,23 +27,23 @@
@watch_list.each do |tube_name|
begin
if @tubes[tube_name].nil?
next
end
- job = @tubes[tube_name]['ready'].pop(false)
+ job = @tubes[tube_name]['ready'].pop(true)
rescue ThreadError
next
end
job['reserves'] += 1
(@tubes[tube_name]['reserved'] ||= []).push job
end
if job.nil?
if timeout
- return nil
+ raise Beanstalk::TimedOut
else
- raise Beanstalk::TimedOut if job.nil?
+ return nil
end
end
Job.new(self, job['id'], job['body'])
end