mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 08:47:10 +00:00
Avoid calling time.monotonic on coordinator refresh unless we are debugging (#70209)
This commit is contained in:
parent
80ab8b465b
commit
c393622b64
@ -183,6 +183,7 @@ class DataUpdateCoordinator(Generic[_T]):
|
|||||||
if scheduled and self.hass.is_stopping:
|
if scheduled and self.hass.is_stopping:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if log_timing := self.logger.isEnabledFor(logging.DEBUG):
|
||||||
start = monotonic()
|
start = monotonic()
|
||||||
auth_failed = False
|
auth_failed = False
|
||||||
|
|
||||||
@ -255,6 +256,7 @@ class DataUpdateCoordinator(Generic[_T]):
|
|||||||
self.logger.info("Fetching %s data recovered", self.name)
|
self.logger.info("Fetching %s data recovered", self.name)
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
|
if log_timing:
|
||||||
self.logger.debug(
|
self.logger.debug(
|
||||||
"Finished fetching %s data in %.3f seconds (success: %s)",
|
"Finished fetching %s data in %.3f seconds (success: %s)",
|
||||||
self.name,
|
self.name,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user