The answer is MessageWorker.perform_at(@message.date_time, @message.id)
Sidekiq perform_at specified datetime
-
04-07-2023 - |
Question
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
OTHER TIPS
For those who can't use perform at you could solve this using set(wait_until: time)
like:
Message.set(wait_until: someTime).perform_later(args)
This will queue your message inside Sidekiq for your desired date-time.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow