Wisp
Wisp copied to clipboard
Log next schedule after completion
Thank you, this is a great library and very useful. One thing that would be handy is to know the next time a job is going to run after it has completed.
We've a lot of jobs scheduled, so I'd rather not iterate through and log out all their stats on a separate fixed schedule.
Perhaps you could add a post execution hook, or simply debug log the result in Scheduler.scheduleNextExecution?
Thank you for your feedback and your interest in Wisp!
Actually this feature is already available through:
- Keeping a reference of the job after the scheduling or getting one through
scheduler.findJob(String name)
- Getting the duration in milliseconds of when the job is going to execute next with:
job.nextExecutionTimeInMillis()
That's fine for the first time a job is scheduled, but I also want to show this at the end of every subsequent execution in the schedule. Since the next execution time is only set after executing my job, I can't see a way of triggering this. I could log from the schedule at the point of setting the next execution time, but that wouldn't have the associated job information. Do you have any suggestions?
Do you think you can elaborate your use case? I am not sure I get the goal of this.
Because if you are trying to build some table that gives you some stats for the schedule jobs or even force the execution of a job, you can do something like this: https://github.com/Coreoz/Plume-admin/blob/master/plume-admin-ws-system/src/main/java/com/coreoz/plume/admin/services/scheduled/AdminSchedulerService.java
I am closing this issue because I do not have feedback.
Feel free to reopen if needed.