PR: #30 (feat/05-clap-cli)
File: crates/charon-cli/src/main.rs
Lines: ~63-65
Problem:
Command::Listen => {
info!("listen: not wired up yet — scanner arrives in Day 2");
}
No signal handler installed. tokio does not catch SIGTERM by default. docker stop sends SIGTERM then SIGKILL after 10s. Once scanner lands, any in-flight liquidation tx or open state file will be dropped mid-operation on every deploy or container restart.
Fix: Establish shutdown pattern now before scanner wiring:
Command::Listen => {
tokio::select! {
_ = run_listen(&config) => {},
_ = tokio::signal::ctrl_c() => {
info!("received SIGINT, shutting down");
},
_ = async {
tokio::signal::unix::signal(
tokio::signal::unix::SignalKind::terminate()
).unwrap().recv().await;
} => {
info!("received SIGTERM, shutting down");
},
}
}
PR: #30 (feat/05-clap-cli)
File: crates/charon-cli/src/main.rs
Lines: ~63-65
Problem:
No signal handler installed. tokio does not catch SIGTERM by default.
docker stopsends SIGTERM then SIGKILL after 10s. Once scanner lands, any in-flight liquidation tx or open state file will be dropped mid-operation on every deploy or container restart.Fix: Establish shutdown pattern now before scanner wiring: