lib/backburner/logger.rb in backburner-1.4.1 vs lib/backburner/logger.rb in backburner-1.5.0
- old
+ new
@@ -8,11 +8,11 @@
end
# Print out when a job is about to begin
def log_job_begin(name, args)
log_info "Work job #{name} with #{args.inspect}"
- @job_started_at = Time.now
+ Thread.current[:job_started_at] = Time.now
end
# Print out when a job completed
# If message is nil, job is considered complete
def log_job_end(name, message = nil)
@@ -22,11 +22,11 @@
log_info("#{action_word} #{name} in #{ms}ms #{message}")
end
# Returns true if the job logging started
def job_started_at
- @job_started_at
+ Thread.current[:job_started_at]
end
# Print a message to stdout
#
# @example
@@ -48,6 +48,6 @@
# Return logger if specified
def logger
Backburner.configuration.logger
end
end
-end
\ No newline at end of file
+end