From 86f2f54abef9c564b9b51542edd57eed398d4d91 Mon Sep 17 00:00:00 2001 From: Leigh Morresi <275001+dgtlmoon@users.noreply.github.com> Date: Sun, 31 Jan 2021 20:07:10 +0100 Subject: [PATCH] Trigger write index after edit of a watch --- backend/backend.py | 2 +- backend/store.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/backend.py b/backend/backend.py index 05d75f56..ce398c6a 100644 --- a/backend/backend.py +++ b/backend/backend.py @@ -235,7 +235,7 @@ def api_update(): datastore.data['watching'][uuid].update({'url': url, 'tag': tag, 'headers':extra_headers}) - + datastore.needs_write = True messages.append({'class': 'ok', 'message': 'Updated watch.'}) diff --git a/backend/store.py b/backend/store.py index 1efa7146..5dc79422 100644 --- a/backend/store.py +++ b/backend/store.py @@ -127,6 +127,7 @@ class ChangeDetectionStore: def sync_to_json(self): + print ("Saving index") with open('/datastore/url-watches.json', 'w') as json_file: json.dump(self.data, json_file, indent=4) self.needs_write = False