From 4170bd5205948a81d0f7f99cdd042b2ffe0ad07e Mon Sep 17 00:00:00 2001 From: Michael Insel Date: Tue, 10 Jul 2018 19:12:12 +0200 Subject: [PATCH] Fix negative 'empty in' value in WorkQueue log message This fixes a negative 'empty in' value in WorkQueue log messages. --- lib/base/workqueue.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/base/workqueue.cpp b/lib/base/workqueue.cpp index ae3dad9b0..7e8ad5890 100644 --- a/lib/base/workqueue.cpp +++ b/lib/base/workqueue.cpp @@ -24,6 +24,7 @@ #include "base/application.hpp" #include "base/exception.hpp" #include +#include using namespace icinga; @@ -221,7 +222,7 @@ void WorkQueue::StatusTimerHandler() if (pending > GetTaskCount(5)) { timeInfo = " empty in "; - if (timeToZero < 0) + if (timeToZero < 0 || std::isinf(timeToZero)) timeInfo += "infinite time, your task handler isn't able to keep up"; else timeInfo += Utility::FormatDuration(timeToZero); -- 2.40.0