update_manager: log when refresh is bypassed

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2022-10-15 11:07:31 -04:00
parent 65e24a14dc
commit b9cac62db8
No known key found for this signature in database
GPG Key ID: 5A1EB336DFB4C71B
1 changed files with 7 additions and 0 deletions

View File

@ -247,6 +247,10 @@ class UpdateManager:
need_notify = False
machine: Machine = self.server.lookup_component("machine")
if machine.validation_enabled():
logging.info(
"update_manger: Install validation pending, bypassing "
"initial refresh"
)
self.initial_refresh_complete = True
return eventtime + UPDATE_REFRESH_INTERVAL
async with self.cmd_request_lock:
@ -401,6 +405,8 @@ class UpdateManager:
await self._check_klippy_printing() or
not self.initial_refresh_complete
):
if check_refresh:
logging.info("update_manager: bypassing refresh request")
check_refresh = False
if check_refresh:
@ -411,6 +417,7 @@ class UpdateManager:
lrt = max([upd.get_last_refresh_time()
for upd in self.updaters.values()])
if time.time() < lrt + 60.:
logging.debug("update_manager: refresh bypassed due to spam")
check_refresh = False
self.cmd_request_lock.release()
vinfo: Dict[str, Any] = {}