mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 23:24:09 +02:00
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
This commit is contained in:
parent
f63d9cce4a
commit
3b7cf5b9b5
@ -337,7 +337,7 @@ Dictionary::Ptr ApiActions::ScheduleDowntime(const ConfigObject::Ptr& object,
|
|||||||
String comment = HttpUtility::GetLastParameter(params, "comment");
|
String comment = HttpUtility::GetLastParameter(params, "comment");
|
||||||
double startTime = HttpUtility::GetLastParameter(params, "start_time");
|
double startTime = HttpUtility::GetLastParameter(params, "start_time");
|
||||||
double endTime = HttpUtility::GetLastParameter(params, "end_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())
|
if (author.IsEmpty() || comment.IsEmpty())
|
||||||
return ApiActions::CreateResult(400, "Options 'author' and 'comment' must not be empty");
|
return ApiActions::CreateResult(400, "Options 'author' and 'comment' must not be empty");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user