fix(runtime): announce the runtime image once, not on every sweep tick
`MissionRuntimeProvisioner::from_env` is called per use — on every mission
launch and from the terminal-mission reaper sweep — so the line added in
cdc45bd would have printed on every tick forever. A log that repeats
itself is a log nobody reads, which would have cost exactly the
visibility the line was added to provide.
Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5
parent
cdc45bd082
commit
9f76f0915b
@@ -583,9 +583,13 @@ impl MissionRuntimeProvisioner {
|
|||||||
Ok(v) if !v.trim().is_empty() => (v, "CLAWMATES_RUNTIME_IMAGE"),
|
Ok(v) if !v.trim().is_empty() => (v, "CLAWMATES_RUNTIME_IMAGE"),
|
||||||
_ => (DEFAULT_IMAGE.to_string(), "the built-in default"),
|
_ => (DEFAULT_IMAGE.to_string(), "the built-in default"),
|
||||||
};
|
};
|
||||||
// Said once at startup, because every mission on this host runs in it
|
// ONCE per process. `from_env` is called per use — on every launch, and
|
||||||
// and nothing else names it out loud.
|
// from the reaper sweep — so a bare eprintln here is a line every sweep
|
||||||
|
// tick forever, which is how a log stops being read at all.
|
||||||
|
static ANNOUNCED: std::sync::Once = std::sync::Once::new();
|
||||||
|
ANNOUNCED.call_once(|| {
|
||||||
eprintln!("mission_runtime: per-mission runtime image = {image} (from {source})");
|
eprintln!("mission_runtime: per-mission runtime image = {image} (from {source})");
|
||||||
|
});
|
||||||
Some(MissionRuntimeProvisioner { docker, image })
|
Some(MissionRuntimeProvisioner { docker, image })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user