fixed timeout issue
This commit is contained in:
+19
-12
@@ -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("/")
|
||||
|
||||
Reference in New Issue
Block a user