From 3b7cf5b9b55f2dfa933b0e5e89bc1285794f21a7 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Tue, 2 Jul 2019 15:12:47 +0200 Subject: [PATCH] API: Don't be so strict with the downtime start_time There may be a slight overlap between the actual request time and 'now'. refs #7271 --- lib/icinga/apiactions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/icinga/apiactions.cpp b/lib/icinga/apiactions.cpp index 9d7edbcc6..f4a5a6f8a 100644 --- a/lib/icinga/apiactions.cpp +++ b/lib/icinga/apiactions.cpp @@ -337,7 +337,7 @@ Dictionary::Ptr ApiActions::ScheduleDowntime(const ConfigObject::Ptr& object, String comment = HttpUtility::GetLastParameter(params, "comment"); double startTime = HttpUtility::GetLastParameter(params, "start_time"); double endTime = HttpUtility::GetLastParameter(params, "end_time"); - double now = Utility::GetTime(); + double now = Utility::GetTime() - 10; //Take a request delay into account. if (author.IsEmpty() || comment.IsEmpty()) return ApiActions::CreateResult(400, "Options 'author' and 'comment' must not be empty"); -- 2.40.0