Template
Fix backup restore freezing the panel with loading feedback.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -229,15 +229,15 @@ for p in {host_paths}; do restore_host_path "$p"; done
|
||||
for p in {container_paths}; do restore_container_path "$p"; done
|
||||
if [ -n "$container" ] && docker inspect "$container" >/dev/null 2>&1; then
|
||||
docker restart "$container" >/dev/null 2>&1 || true
|
||||
# Prefer bringing the WireGuard/AWG interface back up after file restore
|
||||
# Entrypoint usually brings the interface up; give start.sh a short bounded window
|
||||
if docker exec "$container" test -x /opt/amnezia/start.sh >/dev/null 2>&1; then
|
||||
docker exec "$container" /opt/amnezia/start.sh >/dev/null 2>&1 || true
|
||||
timeout 25 docker exec "$container" /opt/amnezia/start.sh >/dev/null 2>&1 || true
|
||||
fi
|
||||
fi
|
||||
printf 'restored:%s\\n' "$protocol"
|
||||
""".strip()
|
||||
|
||||
out, err, code = self.ssh.run_sudo_command(script, timeout=180)
|
||||
out, err, code = self.ssh.run_sudo_command(script, timeout=120)
|
||||
if code != 0:
|
||||
return {'status': 'error', 'message': err or out or 'Failed to restore backup'}
|
||||
return {'status': 'success', 'protocol': protocol, 'filename': safe_name}
|
||||
|
||||
Reference in New Issue
Block a user