fix: старт 2000ms, шаг +500ms — агрессивнее
This commit is contained in:
+4
-4
@@ -94,7 +94,7 @@ def register(app):
|
|||||||
elif mode == "dynamic":
|
elif mode == "dynamic":
|
||||||
script = build_dynamic_script()
|
script = build_dynamic_script()
|
||||||
elif mode == "test":
|
elif mode == "test":
|
||||||
wait = int(request.args.get("wait", 1500))
|
wait = int(request.args.get("wait", 2000))
|
||||||
pid_str = request.args.get("pids", "")
|
pid_str = request.args.get("pids", "")
|
||||||
pids = pid_str.split(",") if pid_str else None
|
pids = pid_str.split(",") if pid_str else None
|
||||||
repeat = int(request.args.get("repeat", 8))
|
repeat = int(request.args.get("repeat", 8))
|
||||||
@@ -349,9 +349,9 @@ def register(app):
|
|||||||
|
|
||||||
ok_count = sum(1 for r in results if r.get("raw", "").startswith("41"))
|
ok_count = sum(1 for r in results if r.get("raw", "").startswith("41"))
|
||||||
err_pct = (total - ok_count) * 100 // total if total > 0 else 100
|
err_pct = (total - ok_count) * 100 // total if total > 0 else 100
|
||||||
wait_ms = int(request.args.get("wait", data.get("wait_ms", 1500)))
|
wait_ms = int(request.args.get("wait", data.get("wait_ms", 2000)))
|
||||||
|
|
||||||
max_runs = 5
|
max_runs = 6
|
||||||
if err_pct < 20 or run >= max_runs:
|
if err_pct < 20 or run >= max_runs:
|
||||||
return jsonify({
|
return jsonify({
|
||||||
"done": True,
|
"done": True,
|
||||||
@@ -361,7 +361,7 @@ def register(app):
|
|||||||
})
|
})
|
||||||
|
|
||||||
# Увеличиваем паузу
|
# Увеличиваем паузу
|
||||||
new_wait = wait_ms + 300
|
new_wait = wait_ms + 500
|
||||||
return jsonify({
|
return jsonify({
|
||||||
"done": False,
|
"done": False,
|
||||||
"message": f"⚠️ {err_pct}% ошибок — увеличиваю паузу до {new_wait}ms",
|
"message": f"⚠️ {err_pct}% ошибок — увеличиваю паузу до {new_wait}ms",
|
||||||
|
|||||||
Reference in New Issue
Block a user