From 03921120d3fe4194fe59d285f57b3cd43dd769cc Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Thu, 24 Feb 2022 16:46:15 +0100 Subject: [PATCH] Minor reliability upgrade for large datasets - retry deepcopy --- changedetectionio/__init__.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/changedetectionio/__init__.py b/changedetectionio/__init__.py index 1232b43a..73c60bbf 100644 --- a/changedetectionio/__init__.py +++ b/changedetectionio/__init__.py @@ -1118,7 +1118,14 @@ def ticker_thread_check_time_launch_checks(): running_uuids.append(t.current_uuid) # Re #232 - Deepcopy the data incase it changes while we're iterating through it all - copied_datastore = deepcopy(datastore) + while True: + try: + copied_datastore = deepcopy(datastore) + except RuntimeError as e: + # RuntimeError: dictionary changed size during iteration + time.sleep(0.1) + else: + break # Check for watches outside of the time threshold to put in the thread queue. for uuid, watch in copied_datastore.data['watching'].items():