This commit is contained in:
dgtlmoon
2025-10-28 16:33:26 +01:00
parent 9ed236434e
commit 2a0131d0f4
4 changed files with 7 additions and 4 deletions

View File

@@ -152,7 +152,10 @@ class ChangeDetectionStore:
self.needs_write = True
# Finally start the thread that will manage periodic data saves to JSON
self.save_data_thread = threading.Thread(target=self.save_datastore).start()
# Only start if thread is not already running (reload_state might be called multiple times)
if not self.save_data_thread or not self.save_data_thread.is_alive():
self.save_data_thread = threading.Thread(target=self.save_datastore)
self.save_data_thread.start()
def rehydrate_entity(self, uuid, entity, processor_override=None):
"""Set the dict back to the dict Watch object"""

View File

@@ -244,7 +244,7 @@ def test_wordcount_conditions_plugin(client, live_server, measure_memory_usage,
# If there was only a change in the whitespacing, then we shouldnt have a change detected
def test_lev_conditions_plugin(client, live_server, measure_memory_usage, datastore_path):
# This should break..
with open(os.path.join(datastore_path, "endpoint-content.txt"), "w") as f:
f.write("""<html>

View File

@@ -118,7 +118,7 @@ def test_trigger_functionality(client, live_server, measure_memory_usage, datast
assert b'has-unread-changes' not in res.data
# Now set the content which contains the trigger text
set_modified_with_trigger_text_response()
set_modified_with_trigger_text_response(datastore_path=datastore_path)
client.get(url_for("ui.form_watch_checknow"), follow_redirects=True)
wait_for_all_checks(client)

View File

@@ -110,7 +110,7 @@ def test_unique_lines_functionality(client, live_server, measure_memory_usage, d
assert b'has-unread-changes' not in res.data
# Now set the content which contains the new text and re-ordered existing text
set_modified_with_trigger_text_response()
set_modified_with_trigger_text_response(datastore_path=datastore_path)
client.get(url_for("ui.form_watch_checknow"), follow_redirects=True)
wait_for_all_checks(client)
res = client.get(url_for("watchlist.index"))