From: Michael Insel Date: Tue, 10 Jul 2018 17:12:12 +0000 (+0200) Subject: Fix negative 'empty in' value in WorkQueue log message X-Git-Tag: v2.10.0~93^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=refs%2Fpull%2F6430%2Fhead;p=icinga2 Fix negative 'empty in' value in WorkQueue log message This fixes a negative 'empty in' value in WorkQueue log messages. --- 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);