-
Notifications
You must be signed in to change notification settings - Fork 151
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
Ability to Cancel a Future Scheduled Job #395
Comments
Hey @sesyilmaz, thanks for writing this question! I'm not sure I understand very well how this feature would work 🤔 As I see it, would the idea be that when the job is due for execution, Solid Queue detects it shouldn't run, and discards it? How would you specify that in a way that Solid Queue can know? I think that whatever the condition, it'd be something that consumes the same resources as if you included it in the job 🤔 I think I might be misunderstanding how you have imagined this feature to work. |
Hello @rosa, I apologize for the delayed response. My question might not have been very clear. I wasn't looking for a way for Solid Queue to detect that it shouldn't run a job. Instead, I wanted to know how to delete, cancel or discard a job on demand if needed. However, two of my colleagues had the chance to have a talk with you and mentioned this issue. Based on your suggestion, we will use the discard method you advised. I will close this issue. Thank you! |
Ahhhh! I understand it now; thanks so much for clarifying and I'm sorry for the misunderstanding! Also, no worries at all about the delay 🙏 |
The link to solution is not working, can you @sesyilmaz posts the used solution here please? I'm probably looking into similar problem: I think I really need this approach, as I cannot reliably and precisely decide on which job is correct one on execution. |
@janpeterka, could you check, in the job, whether the due date is still valid? Or rely on a recurring task that checks all due dates for a given time and performs whatever action is required. |
I have thought about that. We used recurring job in older version of app, but what if job is delayed, so the precise minute is not covered? Same with checking valid time - it would have to be precise to minute, so there's a space for error. However, I realized one way to manage it - o can add due_notified_at column,fill it on creating notification, and resetting it on changing due date. Thank you so much for your help! |
Yeah, it depends on how often and with what margin you need to run the jobs, which would completely depend on what the notifications are for.
You can, this is accessible via
It is possible, yes, using I personally like the solution where you don't need to worry about the underlying job system or about scheduled jobs, which is why I suggested other alternatives, but you can definitely use |
Amazing, thanks for your thorough help! I will try to compare to scheduled time then, I also like it better. |
Hello,
We are planning to use Solid Queue to schedule tasks for future execution. However, we have some use cases where we might need to cancel enqueued jobs before they run.
While we could include logic within the job itself to check business conditions and decide whether to proceed, this approach would still consume unnecessary resources. Therefore, we would prefer the ability to cancel jobs before they execute.
Is there any plan to implement this feature? If so, what timeline would you anticipate for it?
Thanks in advance !
The text was updated successfully, but these errors were encountered: