All threads / RAILS SIDEKIQ SCHEDULER

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

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.

Join the discussion

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

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

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

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.