From 0479a59ff619f82cef0734755cbf08cef5da3ac6 Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Mon, 25 Nov 2024 11:30:10 +0100 Subject: [PATCH] Log before & after an RPC client is disconnected --- lib/remote/jsonrpcconnection.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/remote/jsonrpcconnection.cpp b/lib/remote/jsonrpcconnection.cpp index a5c989aebf..e82d02a76d 100644 --- a/lib/remote/jsonrpcconnection.cpp +++ b/lib/remote/jsonrpcconnection.cpp @@ -207,10 +207,10 @@ void JsonRpcConnection::Disconnect() if (!m_ShuttingDown.exchange(true)) { JsonRpcConnection::Ptr keepAlive (this); - IoEngine::SpawnCoroutine(m_IoStrand, [this, keepAlive](asio::yield_context yc) { - Log(LogWarning, "JsonRpcConnection") - << "API client disconnected for identity '" << m_Identity << "'"; + Log(LogNotice, "JsonRpcConnection") + << "Disconnecting API client for identity '" << m_Identity << "'"; + IoEngine::SpawnCoroutine(m_IoStrand, [this, keepAlive](asio::yield_context yc) { m_OutgoingMessagesQueued.Set(); m_WriterDone.Wait(yc); @@ -251,6 +251,9 @@ void JsonRpcConnection::Disconnect() } else { ApiListener::GetInstance()->RemoveAnonymousClient(this); } + + Log(LogWarning, "JsonRpcConnection") + << "API client disconnected for identity '" << m_Identity << "'"; }); } }