reugn / go-quartz

Minimalist and zero-dependency scheduling library for Go
https://pkg.go.dev/github.com/reugn/go-quartz/quartz
MIT License
1.79k stars 84 forks source link

How are atomic operations on Resume(Job) and Pause(Job) guaranteed in StdScheduler? #128

Open miJasonK opened 7 months ago

miJasonK commented 7 months ago

In the StdScheduler object, if the Remove Job succeeds but the Push Job fails, the task will be lost. How should this scenario be supported?

reugn commented 7 months ago

@miJasonK, this is only relevant for custom JobQueue implementations, as no errors can occur using the standard in-memory queue. And it's a broader question - what happens if the job fails to be rescheduled? I would leave error handling to the implementation, including the application of a retry mechanism and the use of a fallback queue if the backend storage is unavailable.