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