engine: persist the incident ring (LOGSEARCH) across restarts via a periodic + on-shutdown snapshot event, mirroring stat-counter persistence
All checks were successful
CI / check (push) Successful in 3m44s

This commit is contained in:
Jean Chevronnet 2026-07-19 00:46:14 +00:00
parent 754c5d9e95
commit a10662bbc6
No known key found for this signature in database
9 changed files with 102 additions and 6 deletions

View file

@ -165,7 +165,11 @@ pub async fn run(mut proto: Box<dyn Protocol>, engine: Arc<Mutex<Engine>>, addr:
continue;
}
if let NetAction::Shutdown { restart, reason } = act {
engine.lock().await.persist_stats();
{
let mut e = engine.lock().await;
e.persist_stats();
e.persist_incidents();
}
let _ = write.flush().await;
shutdown(restart, &reason);
}
@ -182,7 +186,11 @@ pub async fn run(mut proto: Box<dyn Protocol>, engine: Arc<Mutex<Engine>>, addr:
if let NetAction::SendEmail { to, subject, text, html } = action {
dispatch_email(&email, to, subject, text, html);
} else if let NetAction::Shutdown { restart, reason } = action {
engine.lock().await.persist_stats();
{
let mut e = engine.lock().await;
e.persist_stats();
e.persist_incidents();
}
let _ = write.flush().await;
shutdown(restart, &reason);
} else {