Since there obviously is a cooldown set when we get to this condition, we need to subtract cooldown.time from now instead of subtracting now from cooldown.time, since cooldown.time is always greater than the current timestamp.
This currently results in negative timeout delays and fires the task immediately.
Since there obviously is a cooldown set when we get to this condition, we need to subtract
cooldown.time
fromnow
instead of subtractingnow
fromcooldown.time
, sincecooldown.time
is always greater than the current timestamp.This currently results in negative timeout delays and fires the task immediately.