From 7ae550fd2681c31467bd32a99354948f3cdae681 Mon Sep 17 00:00:00 2001 From: Houkime <> Date: Fri, 26 Jul 2024 10:09:25 +0000 Subject: [PATCH] refactor(system): break out rebuild job creation --- selfprivacy_api/actions/system.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/selfprivacy_api/actions/system.py b/selfprivacy_api/actions/system.py index 7957f77..49c1dab 100644 --- a/selfprivacy_api/actions/system.py +++ b/selfprivacy_api/actions/system.py @@ -106,14 +106,18 @@ def run_blocking(cmd: List[str], new_session: bool = False) -> str: return stdout -def rebuild_system() -> Job: - """Rebuild the system""" - job = Jobs.add( +def add_rebuild_job() -> Job: + return Jobs.add( type_id="system.nixos.rebuild", name="Rebuild system", description="Applying the new system configuration by building the new NixOS generation.", status=JobStatus.CREATED, ) + + +def rebuild_system() -> Job: + """Rebuild the system""" + job = add_rebuild_job() rebuild_system_task(job) return job