IcingaCommand: improve timeout rendering

This commit is contained in:
Thomas Gelf 2015-12-02 02:53:27 +01:00
parent 7ca64e18a7
commit 06736e1508
1 changed files with 9 additions and 0 deletions

View File

@ -50,4 +50,13 @@ class IcingaCommand extends IcingaObject
return c::renderKeyValue('command', c::renderArray($parts));
}
protected function renderTimeout()
{
$value = $this->timeout;
if ($value % 60 === 0) {
$value = ((int) $value / 60) . 'm';
}
return c::renderKeyValue('timeout', $value);
}
}