Compare commits

..

1 Commits

Author SHA1 Message Date
dgtlmoon
45f8e546d6 Try to auto-detect attachments/downloads for text or HTML Re #3434 2025-09-19 10:06:25 +02:00
6 changed files with 36 additions and 43 deletions

View File

@@ -4,13 +4,11 @@ updates:
directory: /
schedule:
interval: "weekly"
"caronc/apprise":
versioning-strategy: "increase"
schedule:
interval: "daily"
groups:
all:
patterns:
- "*"
- package-ecosystem: pip
directory: /
schedule:
interval: "daily"
allow:
- dependency-name: "apprise"

View File

@@ -95,7 +95,7 @@ jobs:
push: true
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/changedetection.io:dev,ghcr.io/${{ github.repository }}:dev
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8,linux/arm64/v8
cache-from: type=gha
cache-to: type=gha,mode=max
@@ -133,7 +133,7 @@ jobs:
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8,linux/arm64/v8
cache-from: type=gha
cache-to: type=gha,mode=max
# Looks like this was disabled

View File

@@ -38,6 +38,8 @@ jobs:
dockerfile: ./Dockerfile
- platform: linux/arm/v8
dockerfile: ./Dockerfile
- platform: linux/arm64/v8
dockerfile: ./Dockerfile
# Alpine Dockerfile platforms (musl via alpine check)
- platform: linux/amd64
dockerfile: ./.github/test/Dockerfile-alpine

View File

@@ -9,7 +9,7 @@ set -x
# SOCKS5 related - start simple Socks5 proxy server
# SOCKSTEST=xyz should show in the logs of this service to confirm it fetched
docker run --network changedet-network -d --hostname socks5proxy --rm --name socks5proxy -p 1080:1080 -e PROXY_USER=proxy_user123 -e PROXY_PASSWORD=proxy_pass123 serjs/go-socks5-proxy
docker run --network changedet-network -d --hostname socks5proxy-noauth --rm -p 1081:1080 --name socks5proxy-noauth -e REQUIRE_AUTH=false serjs/go-socks5-proxy
docker run --network changedet-network -d --hostname socks5proxy-noauth --rm -p 1081:1080 --name socks5proxy-noauth serjs/go-socks5-proxy
echo "---------------------------------- SOCKS5 -------------------"
# SOCKS5 related - test from proxies.json

View File

@@ -130,47 +130,40 @@ def extract_UUID_from_client(client):
def wait_for_all_checks(client=None):
"""
Waits until both queues are empty and all workers are idle.
Optimized for Janus queues with minimal delays.
Waits until the queue is empty and workers are idle.
Much faster than the original with adaptive timing.
"""
from changedetectionio.flask_app import update_q as global_update_q, notification_q
from changedetectionio.flask_app import update_q as global_update_q
from changedetectionio import worker_handler
logger = logging.getLogger()
empty_since = None
attempt = 0
max_attempts = 150 # Still reasonable upper bound
# Much tighter timing with reliable Janus queues
max_attempts = 100 # Reduced from 150
while attempt < max_attempts:
# Start with fast checks, slow down if needed
if attempt < 10:
time.sleep(0.1) # Very fast initial checks
elif attempt < 30:
time.sleep(0.3) # Medium speed
else:
time.sleep(0.8) # Slower for persistent issues
for attempt in range(max_attempts):
# Check both queues and worker status
update_q_size = global_update_q.qsize()
notification_q_size = notification_q.qsize()
q_length = global_update_q.qsize()
running_uuids = worker_handler.get_running_uuids()
any_workers_busy = len(running_uuids) > 0
# Both queues empty and no workers processing
if update_q_size == 0 and notification_q_size == 0 and not any_workers_busy:
# Small delay to account for items being added to queue during processing
time.sleep(0.05)
# Double-check after brief delay
update_q_size = global_update_q.qsize()
notification_q_size = notification_q.qsize()
running_uuids = worker_handler.get_running_uuids()
any_workers_busy = len(running_uuids) > 0
if update_q_size == 0 and notification_q_size == 0 and not any_workers_busy:
return # All clear!
# Adaptive sleep timing - start fast, get slightly slower
if attempt < 20:
time.sleep(0.05) # Very fast initial checks
elif attempt < 50:
time.sleep(0.1) # Medium speed
if q_length == 0 and not any_workers_busy:
if empty_since is None:
empty_since = time.time()
elif time.time() - empty_since >= 0.15: # Shorter wait
break
else:
time.sleep(0.2) # Slower for edge cases
logger.warning(f"wait_for_all_checks() timed out after {max_attempts} attempts")
empty_since = None
attempt += 1
time.sleep(0.3)
# Replaced by new_live_server_setup and calling per function scope in conftest.py
def live_server_setup(live_server):

View File

@@ -39,7 +39,7 @@ jsonpath-ng~=1.5.3
# jq not available on Windows so must be installed manually
# Notification library
apprise==1.9.4
apprise==1.9.3
# - Needed for apprise/spush, and maybe others? hopefully doesnt trigger a rust compile.
# - Requires extra wheel for rPi, adds build time for arm/v8 which is not in piwheels
@@ -51,8 +51,8 @@ cryptography==44.0.1
# use any version other than 2.0.x due to https://github.com/eclipse/paho.mqtt.python/issues/814
paho-mqtt!=2.0.*
# Used for CSS filtering, JSON extraction from HTML
beautifulsoup4>=4.0.0,<=4.13.5
# Used for CSS filtering
beautifulsoup4>=4.0.0
# XPath filtering, lxml is required by bs4 anyway, but put it here to be safe.
# #2328 - 5.2.0 and 5.2.1 had extra CPU flag CFLAGS set which was not compatible on older hardware