public function last_update() {
// fetch time of last update in this RRD file
- static $last_update;
+ static $last_update, $last_saved;
+ if (isset($last_update) && isset($last_saved) && ($last_saved <= (time() - 10))) { unset($last_update); }
if (!isset($last_update) && in_array($this->status, array('ok','readonly'))) {
$last_cmd = $this->rrdtool_bin.' last '.$this->rrd_file;
$return = trim(`$last_cmd 2>&1`);
$last_update = is_numeric($return)?$return:null;
+ $last_saved = time();
}
return isset($last_update)?$last_update:null;
}