mirror of https://github.com/Icinga/icinga2.git
Merge pull request #9805 from Icinga/checkcommand-timeout-0-crashes-icinga-db-daemon-9804
IcingaDB::PrepareObject(): cut off (0) negative Command#timeout for Redis
This commit is contained in:
commit
9cf519316e
|
@ -1516,7 +1516,7 @@ bool IcingaDB::PrepareObject(const ConfigObject::Ptr& object, Dictionary::Ptr& a
|
||||||
Command::Ptr command = static_pointer_cast<Command>(object);
|
Command::Ptr command = static_pointer_cast<Command>(object);
|
||||||
|
|
||||||
attributes->Set("command", JsonEncode(command->GetCommandLine()));
|
attributes->Set("command", JsonEncode(command->GetCommandLine()));
|
||||||
attributes->Set("timeout", command->GetTimeout());
|
attributes->Set("timeout", std::max(0, command->GetTimeout()));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue