lib/backburner/worker.rb in backburner-allq-1.0.49 vs lib/backburner/worker.rb in backburner-allq-1.0.50
- old
+ new
@@ -1,7 +1,5 @@
-require 'backburner/job'
-
module Backburner
#
# @abstract Subclass and override {#process_tube_names}, {#prepare} and {#start} to implement
# a custom Worker class.
#
@@ -33,11 +31,10 @@
options.each_key do |k|
if options[k].instance_of?(Proc)
options[k] = options[k].call job_class, args
end
end
-
options[:shard_key] = options[:shard_key].nil? ? 'X' : options[:shard_key].to_s
pri = resolve_priority(options[:pri] || job_class)
delay = [0, options[:delay].to_i].max
ttr = resolve_respond_timeout(options[:ttr] || job_class)
res = Backburner::Hooks.invoke_hook_events(job_class, :before_enqueue, *args)
@@ -57,9 +54,10 @@
pri: pri,
delay: delay,
ttr: ttr
}
options.merge!(send_data)
+ puts "OPTIONS #{options}"
response = connection.put(tube_name, serialized_data, options)
end
return nil unless Backburner::Hooks.invoke_hook_events(job_class, :after_enqueue, *args)
ensure
connection.close if connection