fix: delay auth restart response

This commit is contained in:
Андрей Бобырев
2026-06-05 19:46:16 +03:00
parent 4a9bc91acf
commit de1c3359bc

3
app.py
View File

@@ -172,10 +172,11 @@ def update_webui_credentials(user: str, password):
log_event("info", "auth_config_updated", user=user, backup=backup) log_event("info", "auth_config_updated", user=user, backup=backup)
if shutil.which("systemctl"): if shutil.which("systemctl"):
subprocess.Popen( subprocess.Popen(
["/bin/sh", "-c", "sleep 0.6; systemctl restart warp-webui.service"], ["/bin/sh", "-c", "sleep 2; systemctl restart warp-webui.service"],
stdout=subprocess.DEVNULL, stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
close_fds=True, close_fds=True,
start_new_session=True,
) )
return 200, { return 200, {
"ok": True, "ok": True,