Add option for scheduled-once jobs to not trigger past their planned execution date
Currently, a job scheduled once for a certain point in time will execute immediately if that point in time is past. Since the scheduler does not keep track of its state between resets, this implies that any job scheduled for a past date will execute immediately on every program startup.
There are cases where such behavior is problematic ; for example, if the module is used to publish messages to subscribers at a given date, and the service it runs on experiences down time, it will publish these messages again.
To address this, there could be an option in Scheduler.once()
(e.g. : trigger_past
) to not re-trigger the provided job if its execution date has passed.