mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
Merge pull request #9992 from Icinga/remove-redundat-cpu-bound-work
Drop redundant `CpuBoundWork` usage in `JsonRpcConnection::Disconnect()`
This commit is contained in:
commit
2be08aa2e0
@ -197,14 +197,14 @@ void JsonRpcConnection::Disconnect()
|
||||
Log(LogWarning, "JsonRpcConnection")
|
||||
<< "API client disconnected for identity '" << m_Identity << "'";
|
||||
|
||||
{
|
||||
CpuBoundWork removeClient (yc);
|
||||
|
||||
if (m_Endpoint) {
|
||||
m_Endpoint->RemoveClient(this);
|
||||
} else {
|
||||
ApiListener::GetInstance()->RemoveAnonymousClient(this);
|
||||
}
|
||||
// We need to unregister the endpoint client as soon as possible not to confuse Icinga 2,
|
||||
// given that Endpoint::GetConnected() is just performing a check that the endpoint's client
|
||||
// cache is not empty, which could result in an already disconnected endpoint never trying to
|
||||
// reconnect again. See #7444.
|
||||
if (m_Endpoint) {
|
||||
m_Endpoint->RemoveClient(this);
|
||||
} else {
|
||||
ApiListener::GetInstance()->RemoveAnonymousClient(this);
|
||||
}
|
||||
|
||||
m_OutgoingMessagesQueued.Set();
|
||||
|
Loading…
x
Reference in New Issue
Block a user