Open zeg-io opened 7 years ago
This is probably a duplicate of my issue from a couple years ago:
https://github.com/bunkat/later/issues/90
There is a built-in buffer of one second because the timer often fires early, but over longer periods of time it can fire more than one second early, causing the duplication.
What I have done in my local copy is increase the buffer to 5 seconds, which has worked well.
In setTimeout, change:
if (diff < 1e3) {
To:
if (diff < 5e3) {
I have a really weird situation.
I have four timers (setIntervals()) which are running. Two only fire once per day. One fires once per hour on the hour, and the other once per hour on the half hour.
Below is the output from my logs. The first thing that happens inside the setInterval function is it outputs the
Update Device Fired
line.Notice that for some unknown reason it is firing one second before the target time, and then again at the actual time!
However, the other hourly event does not trigger twice although it does do the weird second before thing...and it is defined in the same way!