mirror of https://github.com/Icinga/icinga2.git
Defer ExecuteCommandProcessFinishedHandler
This commit is contained in:
parent
134a43d48a
commit
2db7b10ff0
|
@ -97,6 +97,14 @@ void ClusterEvents::ExecuteCheckFromQueue(const MessageOrigin::Ptr& origin, cons
|
|||
return;
|
||||
}
|
||||
|
||||
bool executeCommandProcessFinishedHandlerToBeReset = false;
|
||||
Defer resetExecuteCommandProcessFinishedHandler ([&executeCommandProcessFinishedHandlerToBeReset]() {
|
||||
if (executeCommandProcessFinishedHandlerToBeReset) {
|
||||
Checkable::ExecuteCommandProcessFinishedHandler = nullptr;
|
||||
executeCommandProcessFinishedHandlerToBeReset = false;
|
||||
}
|
||||
});
|
||||
|
||||
if (params->Contains("source")) {
|
||||
String uuid = params->Get("source");
|
||||
|
||||
|
@ -176,6 +184,7 @@ void ClusterEvents::ExecuteCheckFromQueue(const MessageOrigin::Ptr& origin, cons
|
|||
listener->SyncSendMessage(sourceEndpoint, executedMessage);
|
||||
}
|
||||
};
|
||||
executeCommandProcessFinishedHandlerToBeReset = true;
|
||||
}
|
||||
|
||||
if (!listener->GetAcceptCommands()) {
|
||||
|
|
Loading…
Reference in New Issue