Skip to content
Snippets Groups Projects
Commit e7d4e5d2 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

added config entry when expired job is an error

parent a84102b4
No related branches found
No related tags found
No related merge requests found
......@@ -66,7 +66,7 @@ class cronlogrenderer extends cronlog{
$aErrors=array();
$iNextRun=$aEntry['SCRIPTSTARTTIME']+((int)$aEntry['SCRIPTTTL']*60);
if($iNextRun < date("U")){
if($iNextRun < date("U")-$this->_iExpiredJobsFailAfter){
$aErrors[]='outdated';
}
if($aEntry['SCRIPTRC']>0){
......@@ -101,7 +101,7 @@ class cronlogrenderer extends cronlog{
.$aEntry['SCRIPTRC']
.'</td>'
. '<td class="'.($iNextRun < date("U")
? ($iNextRun < date("U") -600 ? 'message-error' : 'message-warning')
? ($iNextRun < date("U") - $this->_iExpiredJobsFailAfter ? 'message-error' : 'message-warning')
: '' ).'">'
. date("Y-m-d H:i", $iNextRun).'</td>'
. '<td class="'.(count($aErrors) ? 'message-error' : '' ).'">'
......
......@@ -13,6 +13,12 @@ class cronlog {
protected $_sDataDir = "__APPDIR__/data";
protected $_iTtlCache = 60; // in sec
/**
* when show an error for expired jobs (latency to execute job and sync logs)
* @var integer
*/
protected $_iExpiredJobsFailAfter = 60*30; // in sec
protected $_aSkipJoblogs = array();
protected $_aServers = false;
......@@ -24,10 +30,12 @@ class cronlog {
public function __construct() {
// read config
if (file_exists(__DIR__.'/../config/inc_cronlog.php')){
$aCfgTemp=include(__DIR__.'/../config/inc_cronlog.php');
$this->_sDataDir = isset($aCfgTemp['sDatadir']) ? $aCfgTemp['sDatadir'] : $this->_sDataDir;
$this->_iTtlCache = isset($aCfgTemp['iTtlCache']) ? (int)$aCfgTemp['iTtlCache'] : $this->_iTtlCache;
$this->_iExpiredJobsFailAfter = isset($aCfgTemp['iExpiredJobsFailAfter']) ? (int)$aCfgTemp['iExpiredJobsFailAfter'] : $this->_iExpiredJobsFailAfter;
$this->_aSkipJoblogs = isset($aCfgTemp['aHidelogs']) && is_array($aCfgTemp['aHidelogs']) ? $aCfgTemp['aHidelogs'] : $this->_aSkipJoblogs;
}
$this->_sDataDir = str_replace("__APPDIR__", dirname(dirname(__FILE__)), $this->_sDataDir);
......
......@@ -8,9 +8,12 @@ return array(
// starting directory with all servers cronwrapper logs
'sDatadir'=>'__APPDIR__/data',
// caching time for infos in the browser
// caching time for serverinfos
'iTtlCache'=>60,
// when show an error for expired jobs (latency to execute job and sync logs)
'iExpiredJobsFailAfter'=>60*30,
// hide these cronjob labels in the web gui
'aHidelogs'=>array(
'copycronlogs',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment