Prevent duckdns from consuming 100% cpu when time abruptly moves forward (#39334)
This commit is contained in:
parent
90ac426a54
commit
f4f8aa3e52
1 changed files with 4 additions and 1 deletions
|
@ -120,7 +120,10 @@ def async_track_time_interval_backoff(hass, action, intervals) -> CALLBACK_TYPE:
|
||||||
failed = 0
|
failed = 0
|
||||||
finally:
|
finally:
|
||||||
delay = intervals[failed] if failed < len(intervals) else intervals[-1]
|
delay = intervals[failed] if failed < len(intervals) else intervals[-1]
|
||||||
remove = async_track_point_in_utc_time(hass, interval_listener, now + delay)
|
# call dt_util.utcnow() again in case time abruptly moves forward
|
||||||
|
remove = async_track_point_in_utc_time(
|
||||||
|
hass, interval_listener, dt_util.utcnow() + delay
|
||||||
|
)
|
||||||
|
|
||||||
hass.async_run_job(interval_listener, dt_util.utcnow())
|
hass.async_run_job(interval_listener, dt_util.utcnow())
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue