fixed timeout issue

This commit is contained in:
2026-06-02 14:26:13 -04:00
parent 50cd3ecc6c
commit 64ed8b81c1
6 changed files with 154 additions and 52 deletions
+19 -12
View File
@@ -1,4 +1,5 @@
import os
import threading
from datetime import datetime, timedelta, timezone
from functools import wraps
from pathlib import Path
@@ -442,10 +443,12 @@ def set_config_route():
if is_scan_in_progress():
return jsonify({"ok": True, "scanning": True, "testCount": None, "completedCount": None})
full_scan(target_dir, results_dir, results_dir_ref)
tests = get_all_tests()
completed = len([t for t in tests if t.get("completed")])
return jsonify({"ok": True, "scanning": False, "testCount": len(tests), "completedCount": completed})
threading.Thread(
target=full_scan,
args=(target_dir, results_dir, results_dir_ref),
daemon=True,
).start()
return jsonify({"ok": True, "scanning": True, "testCount": None, "completedCount": None})
return jsonify({"ok": True, "testCount": None, "completedCount": None})
@@ -464,10 +467,12 @@ def rescan_route():
if is_scan_in_progress():
return jsonify({"ok": True, "scanning": True, "testCount": None, "completedCount": None})
full_scan(target_dir, results_dir, results_dir_ref)
tests = get_all_tests()
completed = len([t for t in tests if t.get("completed")])
return jsonify({"ok": True, "scanning": False, "testCount": len(tests), "completedCount": completed})
threading.Thread(
target=full_scan,
args=(target_dir, results_dir, results_dir_ref),
daemon=True,
).start()
return jsonify({"ok": True, "scanning": True, "testCount": None, "completedCount": None})
@app.post("/api/config/rescan-results")
@@ -483,10 +488,12 @@ def rescan_results_route():
if is_scan_in_progress():
return jsonify({"ok": True, "scanning": True, "testCount": None, "completedCount": None})
scan_results_only(results_dir, results_dir_ref)
tests = get_all_tests()
completed = len([t for t in tests if t.get("completed")])
return jsonify({"ok": True, "scanning": False, "testCount": len(tests), "completedCount": completed})
threading.Thread(
target=scan_results_only,
args=(results_dir, results_dir_ref),
daemon=True,
).start()
return jsonify({"ok": True, "scanning": True, "testCount": None, "completedCount": None})
@app.get("/")