From b57f12f7aec3be2c55029ea42cfa3ad9c7a09a2e Mon Sep 17 00:00:00 2001 From: Aiden McClelland Date: Sun, 27 Feb 2022 21:29:14 -0700 Subject: [PATCH] mute crash notifs during shutdown and increase startup grace period --- backend/src/manager/mod.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/src/manager/mod.rs b/backend/src/manager/mod.rs index ace24a396..bc9e0e158 100644 --- a/backend/src/manager/mod.rs +++ b/backend/src/manager/mod.rs @@ -254,7 +254,7 @@ async fn run_main( .commit_health_check_results .store(true, Ordering::SeqCst); let health = async { - tokio::time::sleep(Duration::from_secs(1)).await; // only sleep for 1 second before first health check + tokio::time::sleep(Duration::from_secs(10)).await; // only sleep for 1 second before first health check loop { let mut db = state.ctx.db.handle(); if let Err(e) = health::check( @@ -488,8 +488,10 @@ async fn manager_thread_loop(mut recv: Receiver, thread_shared: &Arc chrono::Duration::from_std(Duration::from_secs(15)).unwrap() => + if cfg!(feature = "unstable") + || (Utc::now().signed_duration_since(*started) + > chrono::Duration::from_std(Duration::from_secs(60)).unwrap() + && !matches!(&*thread_shared.on_stop.borrow(), &OnStop::Exit)) => { let res = thread_shared.ctx.notification_manager .notify(