Fix negative 'empty in' value in WorkQueue log message

This fixes a negative 'empty in' value in WorkQueue log messages.
This commit is contained in:
Michael Insel 2018-07-10 19:12:12 +02:00
parent ebd9d45a9b
commit 4170bd5205
1 changed files with 2 additions and 1 deletions

View File

@ -24,6 +24,7 @@
#include "base/application.hpp"
#include "base/exception.hpp"
#include <boost/thread/tss.hpp>
#include <math.h>
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);