From a5c8dd69b2fe319c06996c5032f8fcfc6c760b26 Mon Sep 17 00:00:00 2001 From: Mostafa Abdelraouf Date: Wed, 7 Sep 2022 00:22:31 -0500 Subject: [PATCH] Avoid reporting ProtocolSyncError when admin session disconnects (#160) * Avoid reporting ProtocolSyncError when admin session disconnects * rebuild * rebuild --- src/client.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/client.rs b/src/client.rs index ffda6f1..7fe633c 100644 --- a/src/client.rs +++ b/src/client.rs @@ -611,13 +611,6 @@ where message_result = read_message(&mut self.read) => message_result? }; - // Handle admin database queries. - if self.admin { - debug!("Handling admin command"); - handle_admin(&mut self.write, message, self.client_server_map.clone()).await?; - continue; - } - match message[0] as char { // Buffer extended protocol messages even if we do not have // a server connection yet. Hopefully, when we get the S message @@ -637,6 +630,13 @@ where _ => (), } + // Handle admin database queries. + if self.admin { + debug!("Handling admin command"); + handle_admin(&mut self.write, message, self.client_server_map.clone()).await?; + continue; + } + // Get a pool instance referenced by the most up-to-date // pointer. This ensures we always read the latest config // when starting a query.