From 5494e61a05cce0fde739c20396e1ec1bdf645bbd Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Wed, 17 Aug 2022 13:29:32 +0200 Subject: [PATCH] Skip processing when watch was deleted --- changedetectionio/update_worker.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/changedetectionio/update_worker.py b/changedetectionio/update_worker.py index a1a8c90b..d56a9298 100644 --- a/changedetectionio/update_worker.py +++ b/changedetectionio/update_worker.py @@ -237,6 +237,9 @@ class update_worker(threading.Thread): # Other serious error process_changedetection_results = False else: + # Crash protection, the watch entry could have been removed by this point (during a slow chrome fetch etc) + if not self.datastore.data['watching'].get(uuid): + continue # Mark that we never had any failures if not self.datastore.data['watching'][uuid].get('ignore_status_codes'): @@ -244,10 +247,6 @@ class update_worker(threading.Thread): self.cleanup_error_artifacts(uuid) - # Crash protection, the watch entry could have been removed by this point (during a slow chrome fetch etc) - if not self.datastore.data['watching'].get(uuid): - continue - # Different exceptions mean that we may or may not want to bump the snapshot, trigger notifications etc if process_changedetection_results: try: