From d641a3c799ed550b4d7ccddf5ceab1ff34581304 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Mon, 26 Jun 2023 15:36:47 +0200 Subject: [PATCH] IcingaDB::PrepareObject(): cut off (0) negative Command#timeout for Redis not to crash the Go daemon which expects positive values there. --- lib/icingadb/icingadb-objects.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/icingadb/icingadb-objects.cpp b/lib/icingadb/icingadb-objects.cpp index c69893829..cea76c89c 100644 --- a/lib/icingadb/icingadb-objects.cpp +++ b/lib/icingadb/icingadb-objects.cpp @@ -1508,7 +1508,7 @@ bool IcingaDB::PrepareObject(const ConfigObject::Ptr& object, Dictionary::Ptr& a Command::Ptr command = static_pointer_cast(object); attributes->Set("command", JsonEncode(command->GetCommandLine())); - attributes->Set("timeout", command->GetTimeout()); + attributes->Set("timeout", std::max(0, command->GetTimeout())); return true; }