gruijter / com.gruijter.powerhour

Homey app to summarize power meters per hour, day and month
GNU General Public License v3.0
10 stars 16 forks source link

Make hourly job more reliable against drift #240

Closed stefan-schweiger closed 1 month ago

stefan-schweiger commented 1 month ago

Since setInterval (and less so setTimeout) are not guaranteed to run exactly after the specified time they can start to drift after a bit. This implementation does calculate the next runtime of the everyhour job after every run to make sure that a drift is not affecting it.

gruijter commented 1 month ago

Thx for this! On the road right now, so will merge later. Were you able to test it for a while? Does it help with the issue you have?