diff --git a/classes/cronlog-renderer.class.php b/classes/cronlog-renderer.class.php index 48f9aa3185648885086b7a7112952cad743bab37..e139dcb002cdde0f68d9a7a25c32c64ace262af5 100644 --- a/classes/cronlog-renderer.class.php +++ b/classes/cronlog-renderer.class.php @@ -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' : '' ).'">' diff --git a/classes/cronlog.class.php b/classes/cronlog.class.php index ba6c4c043ba28c50752a8a8d7ab5bc11f15de441..50ffabb47afef995a8d50616fc1f2c264763217a 100644 --- a/classes/cronlog.class.php +++ b/classes/cronlog.class.php @@ -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); diff --git a/config/inc_cronlog.php.dist b/config/inc_cronlog.php.dist index 9804246aef833a2456cc1adb363778703b9a6c90..a430a779c2380980020c6e9f0fff3b9f88366450 100644 --- a/config/inc_cronlog.php.dist +++ b/config/inc_cronlog.php.dist @@ -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',