diff --git a/backend/__init__.py b/backend/__init__.py index e597c766..cf090abb 100644 --- a/backend/__init__.py +++ b/backend/__init__.py @@ -450,8 +450,7 @@ class Worker(threading.Thread): app.logger.error("File permission error updating", uuid, str(s)) else: if result: - - result["previous_md5"] = result["current_md5"] + datastore.update_watch(uuid=uuid, update_obj=result) if contents: diff --git a/backend/fetch_site_status.py b/backend/fetch_site_status.py index 225ed812..dad9c2de 100644 --- a/backend/fetch_site_status.py +++ b/backend/fetch_site_status.py @@ -89,6 +89,6 @@ class perform_site_check(): update_obj["last_changed"] = timestamp - update_obj["current_md5"] = fetched_md5 + update_obj["previous_md5"] = fetched_md5 return update_obj, stripped_text_from_html diff --git a/backend/store.py b/backend/store.py index ca0f95f4..49f76681 100644 --- a/backend/store.py +++ b/backend/store.py @@ -198,7 +198,7 @@ class ChangeDetectionStore: def save_history_text(self, uuid, result_obj, contents): output_path = "{}/{}".format(self.datastore_path, uuid) - fname = "{}/{}-{}.stripped.txt".format(output_path, result_obj['current_md5'], str(time.time())) + fname = "{}/{}-{}.stripped.txt".format(output_path, result_obj['previous_md5'], str(time.time())) with open(fname, 'w') as f: f.write(contents) f.close()