From 572a169a47a56e94469c52ac3e1335d58ec1b515 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Tue, 7 Nov 2023 14:15:23 +0100 Subject: [PATCH] tidups --- changedetectionio/blueprint/check_proxies/__init__.py | 4 ++-- changedetectionio/processors/__init__.py | 4 +++- changedetectionio/tests/test_ignore_regex_text.py | 2 -- changedetectionio/update_worker.py | 2 -- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/changedetectionio/blueprint/check_proxies/__init__.py b/changedetectionio/blueprint/check_proxies/__init__.py index 60c98436..06abdfee 100644 --- a/changedetectionio/blueprint/check_proxies/__init__.py +++ b/changedetectionio/blueprint/check_proxies/__init__.py @@ -40,8 +40,8 @@ def construct_blueprint(datastore: ChangeDetectionStore): contents = '' now = time.time() try: - update_handler = text_json_diff.perform_site_check(datastore=datastore) - changed_detected, update_obj, contents = update_handler.run(uuid, preferred_proxy=preferred_proxy, skip_when_checksum_same=False) + update_handler = text_json_diff.perform_site_check(datastore=datastore, watch_uuid=uuid) + changed_detected, update_obj, contents = update_handler.call_browser() # title, size is len contents not len xfer except content_fetcher.Non200ErrorCodeReceived as e: if e.status_code == 404: diff --git a/changedetectionio/processors/__init__.py b/changedetectionio/processors/__init__.py index 8a404982..1cee9ae3 100644 --- a/changedetectionio/processors/__init__.py +++ b/changedetectionio/processors/__init__.py @@ -87,9 +87,11 @@ class difference_detection_processor(): # And here we go! call the right browser with browser-specific settings self.fetcher.run(url, timeout, request_headers, request_body, request_method, ignore_status_codes, self.watch.get('include_filters'), is_binary=is_binary) + + #@todo .quit here could go on close object, so we can run JS if change-detected self.fetcher.quit() - # After init, call run() which will do the actual change-detection + # After init, call run_changedetection() which will do the actual change-detection @abstractmethod def run_changedetection(self, uuid, skip_when_checksum_same=True): diff --git a/changedetectionio/tests/test_ignore_regex_text.py b/changedetectionio/tests/test_ignore_regex_text.py index 49901f38..45f73392 100644 --- a/changedetectionio/tests/test_ignore_regex_text.py +++ b/changedetectionio/tests/test_ignore_regex_text.py @@ -33,8 +33,6 @@ def test_strip_regex_text_func(): "/not" ] - - fetcher = fetch_site_status.perform_site_check(datastore=False) stripped_content = html_tools.strip_ignore_text(test_content, ignore_lines) assert b"but 1 lines" in stripped_content diff --git a/changedetectionio/update_worker.py b/changedetectionio/update_worker.py index f9976dd3..d1045230 100644 --- a/changedetectionio/update_worker.py +++ b/changedetectionio/update_worker.py @@ -410,8 +410,6 @@ class update_worker(threading.Thread): self.datastore.update_watch(uuid=uuid, update_obj={'last_error': str(e)}) # Other serious error process_changedetection_results = False - - # the thread is still running?? else: # Crash protection, the watch entry could have been removed by this point (during a slow chrome fetch etc) if not self.datastore.data['watching'].get(uuid):