Skip to content
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

Run now function for recurring task #140

Closed
rafaelhofmann opened this issue Oct 2, 2020 · 7 comments
Closed

Run now function for recurring task #140

rafaelhofmann opened this issue Oct 2, 2020 · 7 comments

Comments

@rafaelhofmann
Copy link

Hi,

We have many recurring tasks to import data into our database. We are building an admin frontend to display the status (information like last execution, etc) of each recurring task. The missing feature on that frontend is a button "Execute now". The button would trigger the task to be executed now. After the one time execution the task should be scheduled again according to the original schedule.

Something like scheduler.runOnce(taskName : String) would be really nice.

@kagkarlsson
Copy link
Owner

Hi! I like your use-case, building a UI. Some of the methods on SchedulerClient was intended for that purpose, but I never got around to implementing one myself. I think you should be able to achieve what you want using the existing method scheduler.reschedule(TaskInstanceId.of(taskName, id), Instant.now())? After it has run, it will evaluate the Schedule and set next execution time accordingly (which will likely be the same time as it had prior to you pressing the "Execute now" button).

@rafaelhofmann
Copy link
Author

That was exactly what we were looking for. We managed to get the execute now function to work with the reschedule method.
Also, thank you very much for creating and maintaining this library! We were able to replace Quartz and your library is a lot easier to handle.

@kagkarlsson
Copy link
Owner

Excellent 👍
Let me know if there is any other challenges with making a gui for db-scheduler

@kagkarlsson
Copy link
Owner

认真学习

? :)

@archbobo
Copy link

archbobo commented Jan 15, 2022

认真学习

? :)

认真学习 means study something very hard :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@kagkarlsson @rafaelhofmann @archbobo and others