From ed66e4f29146a71916c40a66c96d94d0dc8a5688 Mon Sep 17 00:00:00 2001 From: Sayan Nandan Date: Sun, 13 Feb 2022 05:41:19 -0800 Subject: [PATCH] Decrement threshold on first call --- server/src/arbiter.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/arbiter.rs b/server/src/arbiter.rs index 1b1ab6bf..97280c36 100644 --- a/server/src/arbiter.rs +++ b/server/src/arbiter.rs @@ -202,16 +202,16 @@ pub fn finalize_shutdown(corestore: Corestore, pid_file: FileLock) { }; let mut threshold = TERMSIG_THRESHOLD; macro_rules! check_threshold { - () => { + () => {{ + threshold -= 1; if threshold == 0 { log::error!("SIGTERM received but failed to flush data. Quitting because threshold exceeded"); break false; } else { log::error!("SIGTERM received but failed to flush data. Threshold is at {threshold}"); - threshold -= 1; continue; } - }; + }}; } loop { #[cfg(not(unix))]