Search code examples
ruby-on-railsrubygemssidekiq

Sidekiq perform_at specified datetime


I'm using the SideKiq Ruby gem and I want to use

perform_at

From the wiki I read that I can use

perform_at(3.hours.from_now, 'mike', 1)

...Is there a way to use

perform at

on a specific datetime? For example, if I save a variable

datetime = 2014/Apr/16 22:30

could I just write something like

perform_at(datetime, do_something)


Solution

  • The answer is MessageWorker.perform_at(@message.date_time, @message.id)