From a0b8d8e3ca1dca5d2142a881a4e643f3b5e0dc5e Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Wed, 11 Feb 2026 15:17:19 +0100 Subject: [PATCH] Better to quit --- changedetectionio/store/updates.py | 7 +++---- changedetectionio/tests/test_group.py | 6 ++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/changedetectionio/store/updates.py b/changedetectionio/store/updates.py index 186dd576c..675bc462b 100644 --- a/changedetectionio/store/updates.py +++ b/changedetectionio/store/updates.py @@ -637,11 +637,10 @@ class DatastoreUpdatesMixin: logger.critical("Phase 4/4: Verifying changedetection.json exists...") changedetection_json_new_schema=os.path.join(self.datastore_path, "changedetection.json") if not os.path.isfile(changedetection_json_new_schema): + import sys logger.critical("Migration failed, changedetection.json not found after update ran!") - raise Exception( - "Migration failed: changedetection.json not found after save. " - "url-watches.json remains intact, safe to retry." - ) + sys.exit(1) + logger.critical("Phase 4 complete: Verified changedetection.json exists") diff --git a/changedetectionio/tests/test_group.py b/changedetectionio/tests/test_group.py index 03ae3f51a..8e694114a 100644 --- a/changedetectionio/tests/test_group.py +++ b/changedetectionio/tests/test_group.py @@ -5,6 +5,8 @@ from flask import url_for from .util import live_server_setup, wait_for_all_checks, extract_rss_token_from_UI, get_UUID_for_tag_name, extract_UUID_from_client, delete_all_watches import os +from ..store import ChangeDetectionStore + # def test_setup(client, live_server, measure_memory_usage, datastore_path): # live_server_setup(live_server) # Setup on conftest per function @@ -487,7 +489,6 @@ def test_tag_json_persistence(client, live_server, measure_memory_usage, datasto - Tag deletion removes tag.json file """ import json - from changedetectionio.store import ChangeDetectionStore datastore = client.application.config.get('DATASTORE') @@ -569,9 +570,6 @@ def test_tag_json_migration_update_27(client, live_server, measure_memory_usage, This simulates a pre-update_27 datastore and verifies migration works. """ import json - from changedetectionio.store import ChangeDetectionStore - - datastore = client.application.config.get('DATASTORE') # 1. Create multiple tags tag_names = ['migration-tag-1', 'migration-tag-2', 'migration-tag-3']