Adding a check counter to watch fetching (#1099)

This commit is contained in:
dgtlmoon
2022-11-06 09:48:07 +01:00
committed by GitHub
parent b7e0f0a5e4
commit ca3b351bae
2 changed files with 31 additions and 28 deletions

View File

@@ -282,10 +282,12 @@ class update_worker(threading.Thread):
self.app.logger.error("Exception reached processing watch UUID: %s - %s", uuid, str(e))
self.datastore.update_watch(uuid=uuid, update_obj={'last_error': str(e)})
# Always record that we atleast tried
count = self.datastore.data['watching'][uuid].get('check_count', 0) + 1
self.datastore.update_watch(uuid=uuid, update_obj={'fetch_time': round(time.time() - now, 3),
'last_checked': round(time.time())})
'last_checked': round(time.time()),
'check_count': count
})
# Always save the screenshot if it's available
if update_handler.screenshot: