-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
Scheduler.exists(TaskInstanceId) #38
Comments
Hi!
It will not fetch a specific instance of the task, but if there is only one instance of the task scheduled, you can check it in your code. Let me know if this does not solve your use-case :) |
Thanks for your quick answer!
Can you reconfirm my findings?
|
Hah, good catch, that indeed looks like a bug! In practise, The other one seems ok though? (See test) I have never used this functionality myself, it was PR-ed in. I will fix the bug though. |
So yeah, the method
|
yep, just checked it again, in SchedulerClient, Line 118 (see snipped above) the consumer is also not passed on or called - so it is basicly unused. Your mentioned test seems to just cover the underlying TaskRepository. I will stay with my Exception-Handler by now and see if you manage to provide a bugfix some time. Thanks again for providing this marvellous library :) |
Thanks for the feedback. Will get this issue fixed asap :) |
No hurry. Maybe you could also provide the |
Btw, what about the reschedule-method |
Ah, no, you must handle exceptions in that case aswell. |
yep, just gave it a try: But no hurry - so far I can live with my handled |
PR #42 has a fix for the Will probably implement a method |
The fix is now available in version |
cool, thanks for that. Will give it a try later and provide you feedback. |
Just tried it -> works like a charme! Thanks for the quick fix!
One improvement still: Could you also implement StandardTaskInstanceId.equals(..) and .hashCode() so I do not explicitly have to compare |
PR #53 provides a method |
I'm using your library to fulfill a timeout-watchdog. So basicly I use OneTimeTasks that timeout unless reset (canceled and rescheduled) before.
Currently I'm catching the RuntimeException of scheduler.cancel and schedule the task again as follows:
What I'm looking for is an exists-Method to get rid of this ugly exception handling, e.g.:
The text was updated successfully, but these errors were encountered: