Wednesday, 15 May 2013

ruby on rails - Delayed Job not scheduling on time -



ruby on rails - Delayed Job not scheduling on time -

i have next delayed job setup in model follows:

def expire_listing(listing_id) puts "expiring" end handle_asynchronously :expire_listing, :run_at => proc.new { 1.minutes.from_now }

however when delayed job gets scheduled follows:

#<delayed::backend::activerecord::job id: 5, priority: 0, attempts: 0, handler: "--- !ruby/object:delayed::performablemethod\nobject...", last_error: nil, run_at: "2014-10-23 18:13:00", locked_at: nil, failed_at: nil, locked_by: nil, queue: nil, created_at: "2014-10-23 18:12:00", updated_at: "2014-10-23 18:12:00">

you can notice run_at time 4 hours ahead (2014-10-23 18:13:00) of current time 2014-10-23 14:12:00

how can prepare runs 1 min current time?

try using gem, it's useful https://github.com/kensodev/perform_later

ruby-on-rails rails-activerecord delayed-job

No comments:

Post a Comment