diff --git a/lib/icinga/clusterevents-check.cpp b/lib/icinga/clusterevents-check.cpp index a1b2f89ee..e513f1fef 100644 --- a/lib/icinga/clusterevents-check.cpp +++ b/lib/icinga/clusterevents-check.cpp @@ -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()) {