From 3e6dee9dc81b6f627c975c3c96e88b635e916819 Mon Sep 17 00:00:00 2001 From: chriskaliX Date: Fri, 8 Mar 2024 00:00:42 +0800 Subject: [PATCH] eguard: opts --- SDK/rust/src/logger.rs | 6 ++++++ plugins/eguard/src/main.rs | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/SDK/rust/src/logger.rs b/SDK/rust/src/logger.rs index afc6baee..141c573a 100644 --- a/SDK/rust/src/logger.rs +++ b/SDK/rust/src/logger.rs @@ -191,6 +191,12 @@ impl Logger { } } +impl Drop for Logger { + fn drop(&mut self) { + self.flush() + } +} + impl Log for Logger { fn enabled(&self, metadata: &log::Metadata<'_>) -> bool { metadata.level() diff --git a/plugins/eguard/src/main.rs b/plugins/eguard/src/main.rs index 74aa7c01..7ac16bca 100644 --- a/plugins/eguard/src/main.rs +++ b/plugins/eguard/src/main.rs @@ -93,10 +93,7 @@ fn main() -> Result<()> { let result = match tokio::time::timeout(timeout, client_c.receive_async()).await { Ok(result) => result, - Err(err) => { - error!("get task failed:{}", err); - continue; - } + Err(_) => continue, // ignore timeout }; let task = match result {