Merge pull request #10444 from Icinga/ProcessingResult-NoCheckResult

Remove unused ProcessingResult::NoCheckResult
This commit is contained in:
Alexander Aleksandrovič Klimov 2025-05-20 12:54:41 +02:00 committed by GitHub
commit 5c20b1ae12
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 7 deletions

View File

@ -130,8 +130,6 @@ Dictionary::Ptr ApiActions::ProcessCheckResult(const ConfigObject::Ptr& object,
switch (result) { switch (result) {
case Result::Ok: case Result::Ok:
return ApiActions::CreateResult(200, "Successfully processed check result for object '" + checkable->GetName() + "'."); return ApiActions::CreateResult(200, "Successfully processed check result for object '" + checkable->GetName() + "'.");
case Result::NoCheckResult:
return ApiActions::CreateResult(400, "Could not process check result for object '" + checkable->GetName() + "' because no check result was passed.");
case Result::CheckableInactive: case Result::CheckableInactive:
return ApiActions::CreateResult(503, "Could not process check result for object '" + checkable->GetName() + "' because the object is inactive."); return ApiActions::CreateResult(503, "Could not process check result for object '" + checkable->GetName() + "' because the object is inactive.");
case Result::NewerCheckResultPresent: case Result::NewerCheckResultPresent:

View File

@ -100,14 +100,13 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
{ {
using Result = Checkable::ProcessingResult; using Result = Checkable::ProcessingResult;
VERIFY(cr);
{ {
ObjectLock olock(this); ObjectLock olock(this);
m_CheckRunning = false; m_CheckRunning = false;
} }
if (!cr)
return Result::NoCheckResult;
double now = Utility::GetTime(); double now = Utility::GetTime();
if (cr->GetScheduleStart() == 0) if (cr->GetScheduleStart() == 0)

View File

@ -14,7 +14,10 @@ static void CheckableProcessCheckResult(const CheckResult::Ptr& cr)
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Checkable::Ptr self = vframe->Self; Checkable::Ptr self = vframe->Self;
REQUIRE_NOT_NULL(self); REQUIRE_NOT_NULL(self);
self->ProcessCheckResult(cr);
if (cr) {
self->ProcessCheckResult(cr);
}
} }
Object::Ptr Checkable::GetPrototype() Object::Ptr Checkable::GetPrototype()

View File

@ -119,7 +119,6 @@ public:
enum class ProcessingResult enum class ProcessingResult
{ {
Ok, Ok,
NoCheckResult,
CheckableInactive, CheckableInactive,
NewerCheckResultPresent, NewerCheckResultPresent,
}; };