From 8226f03e7c37099d76aba33a38a3e74f3ac29762 Mon Sep 17 00:00:00 2001 From: Noor Date: Fri, 27 Dec 2024 10:08:29 +0000 Subject: [PATCH] fix grpc client error reset timeout on inbound message insted of creating new timer which was triggering timeout --- src/grpc/server.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/grpc/server.rs b/src/grpc/server.rs index 9f60512..8830c21 100644 --- a/src/grpc/server.rs +++ b/src/grpc/server.rs @@ -163,10 +163,11 @@ impl Update for NodeServer { let error_status: Status; // Gets initialized inside loop let mut timeout = interval(state.get_timeout()); + timeout.tick().await; loop { tokio::select! { Some(msg) = inbound.next() => { - timeout = interval(state.get_timeout()); + timeout.reset(); match msg { Ok(update) => { if update.ip == remote_ip {