From a7812475f4d5cc225b954b690b1a030643ebea4b Mon Sep 17 00:00:00 2001 From: Edouard Vanbelle Date: Sun, 30 Aug 2026 16:42:39 +0200 Subject: [PATCH] fix(jobs): a startup job should not report completion twice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every startup job logged two info lines saying the same thing: the scheduler engine's `job.run` (outcome + timing, which every dispatch has always produced) and my `job.startup_completed` right after it. Reading the boot log, that looks like the job ran twice. Demoted to debug. The engine's line is the one that matters — logging uniformly is the reason startup jobs go through `registry.trigger` rather than calling handlers directly — and the `job.startup_trigger` audit line before it already records that the startup path was the caller, along with the flags it used. Co-Authored-By: Claude Opus 5 (1M context) --- src/common/di.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/common/di.rs b/src/common/di.rs index 0391185c..f6ea7345 100644 --- a/src/common/di.rs +++ b/src/common/di.rs @@ -2912,7 +2912,15 @@ impl AppServiceFactory { job.name, ); match registry.trigger(&job.name, &job.args).await { - Some(outcome) => tracing::info!( + // Debug, not info. The engine already logs every + // dispatch as `job.run` with the outcome and timing — + // that is the point of routing through `trigger` + // rather than calling handlers directly. An info line + // here made every startup job report completion + // twice, from two layers, saying the same thing. The + // `job.startup_trigger` audit line above already + // records that the startup path was the caller. + Some(outcome) => tracing::debug!( target: "oxicloud::scheduler", event = "job.startup_completed", job = %job.name,