I have a same task that i want to run twice – one after 30min, one after 120 min.
I am writing it this way now, but i am sure there is a better way around it
def postpone_30_min
// same task
end
handle_asynchronously :postpone_30_min, :run_at => Proc.new { 30.minutes.from_now }
def postpone_120_min
// same task
end
handle_asynchronously :postpone_120_min, :run_at => Proc.new { 1200.minutes.from_now }
Try this (assuming you are using the latest version of DJ):