Minor reliability upgrade for large datasets - retry deepcopy

ticket-242-reliability-dict
dgtlmoon 3 years ago
parent fda93c3798
commit 03921120d3

@ -1118,7 +1118,14 @@ def ticker_thread_check_time_launch_checks():
running_uuids.append(t.current_uuid) running_uuids.append(t.current_uuid)
# Re #232 - Deepcopy the data incase it changes while we're iterating through it all # Re #232 - Deepcopy the data incase it changes while we're iterating through it all
while True:
try:
copied_datastore = deepcopy(datastore) 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. # Check for watches outside of the time threshold to put in the thread queue.
for uuid, watch in copied_datastore.data['watching'].items(): for uuid, watch in copied_datastore.data['watching'].items():

Loading…
Cancel
Save