From 923d7fbdb461ecbae8da917eb55cbfbc783b95d7 Mon Sep 17 00:00:00 2001 From: mariari Date: Wed, 1 Nov 2023 14:33:43 +0800 Subject: [PATCH] fud v2 --- src/server.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/server.rs b/src/server.rs index 25dd063..09e2bb0 100644 --- a/src/server.rs +++ b/src/server.rs @@ -168,6 +168,13 @@ where let server = self.clone(); let listener_clone = listener.clone(); + let s = server.clone(); + let conn = Connection { + consensus: s.consensus.clone(), + mempool: s.mempool.clone(), + info: s.info.clone(), + snapshot: s.snapshot.clone(), + }; tokio::spawn(async move { let s = server.clone(); backoff::future::retry::<_, BoxError, _, _, _>( @@ -175,12 +182,6 @@ where || async { match listener_clone.accept().await { Ok((socket, _addr)) => { - let conn = Connection { - consensus: s.consensus.clone(), - mempool: s.mempool.clone(), - info: s.info.clone(), - snapshot: s.snapshot.clone(), - }; if let Err(e) = conn.run(socket).await { match e.downcast::() {