]> granicus.if.org Git - icinga2/commitdiff
API: Don't be so strict with the downtime start_time
authorMichael Friedrich <michael.friedrich@icinga.com>
Tue, 2 Jul 2019 13:12:47 +0000 (15:12 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Tue, 2 Jul 2019 13:13:36 +0000 (15:13 +0200)
There may be a slight overlap between the actual request
time and 'now'.

refs #7271

lib/icinga/apiactions.cpp

index 9d7edbcc6f3b11cddb9d7b497b6650e36cebb250..f4a5a6f8ade4aa0b100d9de5ea01defb99c94fe0 100644 (file)
@@ -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");