From 8d5e501932c6173b956027efe7f65a67fa71b9b4 Mon Sep 17 00:00:00 2001 From: Kremilly Date: Sat, 16 Nov 2024 02:55:11 -0300 Subject: [PATCH] feat: add process exit on max retry attempts in DumpHandlers --- src/helpers/dump_handlers.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/helpers/dump_handlers.rs b/src/helpers/dump_handlers.rs index e898763..a28648b 100644 --- a/src/helpers/dump_handlers.rs +++ b/src/helpers/dump_handlers.rs @@ -1,9 +1,10 @@ use chrono::Local; use std::{ - fs, - thread, - path::Path, + fs, + thread, + process, + path::Path, time::Duration, }; @@ -58,6 +59,7 @@ impl DumpHandlers { *attempt += 1; if *attempt >= max_retries as usize { ErrorsAlerts::max_attempts(); + process::exit(1); } else { NormalAlerts::reconnect(*attempt as u64, max_retries); thread::sleep(Duration::from_secs(retry_interval));