biddster / node-red-contrib-schedex

Scheduler for node-red which allows you to enter on/off times as 24hr clock (e.g. 01:10) or suncalc events (e.g. goldenHour). It also allows you to offset times and randomise the time within the offset.
22 stars 17 forks source link

reset all events on system time changes like NTP #93

Closed razvanstanga closed 2 years ago

razvanstanga commented 2 years ago

I am having a problem when the system time changes (ex: NTP after a restart) and the events are late. More details about the problem here https://discourse.nodered.org/t/inject-node-runs-late-sometimes/30365/56?page=2

Please take a look at this : https://github.com/razvanstanga/node-red-contrib-eztimer-ha/commit/62119b53eb6e364ec3acbf5efbc77acf07fed488

It's not tested. I will test it soon. Is the logic correct suspend() -> resume() ? I am not very familiar with the code.