From 370323cf849a2f6452f3d4dd27ab3c704591f213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Herbel?= Date: Fri, 22 Nov 2024 10:33:23 +0100 Subject: [PATCH] Scheduler main: Check for cancellation between base setup and setup steps Barely makes a difference but is the correct thing to do. --- src/bin/scheduler/main.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bin/scheduler/main.rs b/src/bin/scheduler/main.rs index dc2e9ad1..1e187d88 100644 --- a/src/bin/scheduler/main.rs +++ b/src/bin/scheduler/main.rs @@ -64,6 +64,11 @@ fn run() -> Result<(), Terminate> { setup::base_directories::setup(&global_config, &plans)?; info!("Base setup completed"); + if global_config.cancellation_token.is_cancelled() { + info!("Terminated"); + return Ok(()); + } + write_phase(&SchedulerPhase::Setup, &global_config)?; let (plans, setup_failures) = setup::steps::run::run(&global_config, plans)?; info!("Setup steps completed");