14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/creeper/legacy.rb', line 14
def enqueue!(job, *args)
options = args.last.is_a?(Hash) ? args.last : {}
priority = options[:priority] || options[:pri] || 65536
delay = [ 0, options[:delay].to_i ].max
time_to_run = options[:time_to_run] || options[:ttr] || 120
klass = options[:class] || job_descriptions[job]
Creeper::Client.push({
'queue' => job,
'args' => args,
'class' => klass,
'delay' => delay,
'priority' => priority,
'time_to_run' => time_to_run
})
end
|