mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-15 22:51:37 -07:00
fix Potential UnboundLocalError
This commit is contained in:
@@ -505,6 +505,8 @@ def _run_docker_compose(
|
|||||||
"""Collect logs with retry to handle timing races where container hasn't flushed output yet."""
|
"""Collect logs with retry to handle timing races where container hasn't flushed output yet."""
|
||||||
logs_cmd = cmd + ["logs"]
|
logs_cmd = cmd + ["logs"]
|
||||||
best_result: subprocess.CompletedProcess | None = None
|
best_result: subprocess.CompletedProcess | None = None
|
||||||
|
# Initialize with a safe default in case loop doesn't run
|
||||||
|
logs_result = subprocess.CompletedProcess(logs_cmd, 1, stdout="", stderr="No log attempts made")
|
||||||
for attempt in range(max_attempts):
|
for attempt in range(max_attempts):
|
||||||
print(f"Running logs cmd (attempt {attempt + 1}/{max_attempts}): {logs_cmd}")
|
print(f"Running logs cmd (attempt {attempt + 1}/{max_attempts}): {logs_cmd}")
|
||||||
logs_result = subprocess.run(
|
logs_result = subprocess.run(
|
||||||
|
|||||||
Reference in New Issue
Block a user