Merge pull request #6430 from Icinga/fix/workqueue-log-message

Fix negative 'empty in' value in WorkQueue log message
This commit is contained in:
Michael Friedrich 2018-07-26 09:59:53 +02:00 committed by GitHub
commit 62e91e1891
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);