kopia lustrzana https://github.com/dgtlmoon/changedetection.io
use the queu size
rodzic
1bd3068449
commit
cca55444ea
|
@ -126,21 +126,25 @@ def extract_UUID_from_client(client):
|
||||||
uuid = m.group(1)
|
uuid = m.group(1)
|
||||||
return uuid.strip()
|
return uuid.strip()
|
||||||
|
|
||||||
def wait_for_all_checks(client):
|
def wait_for_all_checks(client=None):
|
||||||
# actually this is not entirely true, it can still be 'processing' but not in the queue
|
# actually this is not entirely true, it can still be 'processing' but not in the queue
|
||||||
# Loop waiting until done..
|
# Loop waiting until done..
|
||||||
attempt=0
|
attempt=0
|
||||||
# because sub-second rechecks are problematic in testing, use lots of delays
|
# because sub-second rechecks are problematic in testing, use lots of delays
|
||||||
time.sleep(1)
|
time.sleep(1.2)
|
||||||
|
|
||||||
|
from changedetectionio.flask_app import update_q as global_update_q
|
||||||
|
|
||||||
while attempt < 60:
|
while attempt < 60:
|
||||||
res = client.get(url_for("watchlist.index"))
|
# Get queue size safely - update_q is a SignalPriorityQueue
|
||||||
if not b'Checking now' in res.data:
|
q_length = global_update_q.qsize()
|
||||||
|
if not q_length:
|
||||||
break
|
break
|
||||||
logging.getLogger().info(f"Waiting for watch-list to not say 'Checking now'.. {attempt}")
|
logging.getLogger().info(f"Waiting for empty queue.... {attempt}")
|
||||||
time.sleep(1)
|
time.sleep(0.8)
|
||||||
attempt += 1
|
attempt += 1
|
||||||
|
|
||||||
time.sleep(1)
|
time.sleep(1.2)
|
||||||
|
|
||||||
def live_server_setup(live_server):
|
def live_server_setup(live_server):
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue