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
All checks were successful
CI / check (push) Successful in 3m44s
This commit is contained in:
parent
754c5d9e95
commit
a10662bbc6
9 changed files with 102 additions and 6 deletions
12
src/link.rs
12
src/link.rs
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue