Details
-
Improvement
-
Resolution: Declined
-
Major
-
6.0.0
-
None
Description
If timers are created in the past, they are still executed in the next available time slot. If someone accidentally(javascript math anomalies) creates timers few years or decades in the past, they are still executed when system resources are available.
It would be useful to contain this behaviour by exposing a parameter(modifiable via REST endpoint) that captures a stale window.
At execution: a check is done before the timer is executed, if stale, do not fire.
At Creation : a check is done at timer's creation, if stale, eventing could throw a warning/exception with a specific code.
In the absence of such a check, developer has to write the following check in his/her code:
func callback(context)
{
//context.my_deadline is the parameter in the timer payload
if new Date().getTime() > context.my_deadline{
// stale-window exceeded, do not execute the rest of the timer
return;}
}