Skip to content

Commit

Permalink
Log before & after an RPC client is disconnected
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabteab committed Nov 27, 2024
1 parent 16d6c23 commit 0479a59
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/remote/jsonrpcconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -251,6 +251,9 @@ void JsonRpcConnection::Disconnect()
} else {
ApiListener::GetInstance()->RemoveAnonymousClient(this);
}

Log(LogWarning, "JsonRpcConnection")
<< "API client disconnected for identity '" << m_Identity << "'";
});
}
}
Expand Down

0 comments on commit 0479a59

Please sign in to comment.