Home Sidekiq where is the job located right after being set using delay extension
Reply: 0

Sidekiq where is the job located right after being set using delay extension

user950
1#
user950 Published in May 27, 2018, 3:38 am

I'm scheduling a job with Sidekiq and want to check the queue size right after I schedule it:

MyClass.delay.my_method
Sidekiq::ScheduledSet.new.size # => 0
Sidekiq::Queue.new.size # => 0

And I'm surprised that the queue is empty, though I see in the monitoring UI that the job was not yet executed (and in fact it gets executed moments later).

My real case is a bit more complex. I schedule a job and then render a page, and on that page I have a check if jobs of certain type are scheduled or running, but that all seems to happen to fast and my check fails (if I reload the page right away then the check succeeds).

I'm guessing there is a tiny delay between calling delay and the job actually ending up on any of the queues. Is there a way I can go around this, i.e. to check for all such jobs (that haven't yet landed on the queue).

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.300956 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO