mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-07 08:31:06 +00:00
chore: more debugging outuput
This commit is contained in:
parent
ad069a2ad2
commit
c851c3d193
|
@ -66,8 +66,9 @@ def rebuild_system_task(job: Job, upgrade: bool = False):
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
text=True,
|
text=True,
|
||||||
)
|
)
|
||||||
print(status.stdout.strip())
|
print(f"Unit status: {status.stdout.strip()}")
|
||||||
if status.stdout.strip() == "inactive":
|
if status.stdout.strip() == "inactive":
|
||||||
|
print("System rebuilt.")
|
||||||
Jobs.update(
|
Jobs.update(
|
||||||
job=job,
|
job=job,
|
||||||
status=JobStatus.FINISHED,
|
status=JobStatus.FINISHED,
|
||||||
|
@ -76,6 +77,7 @@ def rebuild_system_task(job: Job, upgrade: bool = False):
|
||||||
)
|
)
|
||||||
break
|
break
|
||||||
elif status.stdout.strip() == "failed":
|
elif status.stdout.strip() == "failed":
|
||||||
|
print("System rebuild failed.")
|
||||||
Jobs.update(
|
Jobs.update(
|
||||||
job=job,
|
job=job,
|
||||||
status=JobStatus.ERROR,
|
status=JobStatus.ERROR,
|
||||||
|
@ -106,6 +108,7 @@ def rebuild_system_task(job: Job, upgrade: bool = False):
|
||||||
)
|
)
|
||||||
# Timeout of 60 minutes
|
# Timeout of 60 minutes
|
||||||
if time.time() - start_time > 3600:
|
if time.time() - start_time > 3600:
|
||||||
|
print("System rebuild timed out.")
|
||||||
Jobs.update(
|
Jobs.update(
|
||||||
job=job,
|
job=job,
|
||||||
status=JobStatus.ERROR,
|
status=JobStatus.ERROR,
|
||||||
|
@ -114,6 +117,7 @@ def rebuild_system_task(job: Job, upgrade: bool = False):
|
||||||
break
|
break
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
|
print("subprocess.CalledProcessError")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
|
|
Loading…
Reference in a new issue