Do CurrentConcurrentChecks and DecreasePendingChecks only for check_command

This commit is contained in:
Mattia Codato 2020-07-16 16:52:48 +02:00
parent d4fb5a0656
commit 461b4e2176
1 changed files with 5 additions and 3 deletions

View File

@ -140,13 +140,15 @@ void ClusterEvents::ExecuteCheckFromQueue(const MessageOrigin::Ptr& origin, cons
}
Checkable::ExecuteCommandProcessFinishedHandler = [checkable, listener, sourceEndpoint, origin, params] (const Value& commandLine, const ProcessResult& pr) {
Checkable::CurrentConcurrentChecks.fetch_sub(1);
Checkable::DecreasePendingChecks();
if (params->Get("command_type") == "check_command") {
Checkable::CurrentConcurrentChecks.fetch_sub(1);
Checkable::DecreasePendingChecks();
}
if (pr.ExitStatus > 3) {
Process::Arguments parguments = Process::PrepareCommand(commandLine);
Log(LogWarning, "ApiListener")
<< "Check command for object '" << checkable->GetName() << "' (PID: " << pr.PID
<< "Command for object '" << checkable->GetName() << "' (PID: " << pr.PID
<< ", arguments: " << Process::PrettyPrintArguments(parguments) << ") terminated with exit code "
<< pr.ExitStatus << ", output: " << pr.Output;
}