Open razvanstanga opened 2 years ago
Dec 23 16:52:24 ha systemd-timesyncd[178]: Synchronized to time server for the first time 216.229.4.66:123 (1.us.pool.ntp.org). Dec 23 16:52:24 ha Node-RED[233]: 23 Dec 16:52:24 - [info] [eztimer:147727ae.33f438] System Time Change Detected!
The case is :
Steps to reproduce : systemctl stop systemd-timesyncd.service date -s "2021-12-23 17:10:00" # something behind the current time systemctl restart nodered # wait for it to restart systemctl start systemd-timesyncd.service tail -n 100 /var/log/syslog
Dec 23 17:32:48 ha Node-RED[952]: 23 Dec 17:32:48 - [info] [eztimer:acf2bbd8.e4d9e8] System time change detected! Dec 23 17:32:48 ha Node-RED[952]: 23 Dec 17:32:48 - [info] [eztimer:acf2bbd8.e4d9e8] --- old time was :2021-12-23 17:11:27 Dec 23 17:32:48 ha Node-RED[952]: 23 Dec 17:32:48 - [info] [eztimer:acf2bbd8.e4d9e8] --- new time is :2021-12-23 17:32:48
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.