Ask A Question

Notifications

You’re not receiving notifications from this thread.

RAILS SIDEKIQ SCHEDULER

Simon Eric Noumedem asked in Rails

I would like to launch the worker after an action and this worker must be launch automatically after every 5 seconds to check a status and when the status is checked, it must be stops. How can I do that? Thanks for your help

Reply

I would suggest creating a worker that checks the status, and if the status is not completed, it schedules a copy of itself to run 5.seconds.from_now. That way it can continuously keep checking and spawning new workers as needed until it's complete, or you've hit a timeout length or something.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 79,047+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

    © 2023 GoRails, LLC. All rights reserved.