lib/backburner/worker.rb in backburner-0.4.4 vs lib/backburner/worker.rb in backburner-0.4.5
- old
+ new
@@ -134,11 +134,12 @@
# Each job is performed by invoking `perform` on the job class.
#
# @example
# @worker.work_one_job
#
- def work_one_job
- job = Backburner::Job.new(self.connection.tubes.reserve)
+ def work_one_job(conn = nil)
+ conn ||= self.connection
+ job = Backburner::Job.new(conn.tubes.reserve)
self.log_job_begin(job.name, job.args)
job.process
self.log_job_end(job.name)
rescue Backburner::Job::JobFormatInvalid => e
self.log_error self.exception_message(e)
\ No newline at end of file