-
-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing: how do I force the scheduler to empty out it's queue? #87
Comments
I solved this myself, one uses E.g,
|
I'm reopening this issue because I think we should have a scheduler.empty() method to do this easily. |
Hi @selwin, what do you expect |
Running |
so with empty it would look like something like (for testing):
However, in my case where I came across this, I have jobs scheduling new jobs... so this would be more like what I was doing:
|
@jmmills there seems to be a miscommunication. What I think scheduler.enqueue_in(...)
scheduler.count() # Returns 1
scheduler.empty()
scheduler.count() # Returns 0 |
+1 |
@selwin I know it's kind of late, but is this what you are looking for?
|
@c-simpson BTW, I found the right way to empty queue:
So the right way to empty queue is :
|
Use case: Testing a system where objects are expired from a database at scheduled times, how does one force the scheduler to run jobs?
Is it as simple as creating an RQ
SimpleWorker
attached to the "scheduled queue", or is there a better way?The text was updated successfully, but these errors were encountered: