update_manger: log remaining refresh time on init

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan
2023-07-07 06:06:07 -04:00
parent 1c16233da0
commit 3f1e9e397e
3 changed files with 25 additions and 6 deletions

View File

@@ -236,7 +236,9 @@ class UpdateManager:
async def _handle_auto_refresh(self, eventtime: float) -> float:
cur_hour = time.localtime(time.time()).tm_hour
log_remaining_time = True
if self.initial_refresh_complete:
log_remaining_time = False
# Update when the local time is between 12AM and 5AM
if cur_hour >= MAX_UPDATE_HOUR:
return eventtime + UPDATE_REFRESH_INTERVAL
@@ -256,7 +258,7 @@ class UpdateManager:
async with self.cmd_request_lock:
try:
for name, updater in list(self.updaters.items()):
if updater.needs_refresh():
if updater.needs_refresh(log_remaining_time):
await updater.refresh()
need_notify = True
except Exception: