From 6c78358ab7a643c11a23235ed6594d37e59539ff Mon Sep 17 00:00:00 2001 From: agp8x Date: Mon, 28 Jul 2014 21:58:27 +0200 Subject: [PATCH] added check for partial empty summaries, disabled --- draw.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/draw.php b/draw.php index c9c1149..1110d2a 100644 --- a/draw.php +++ b/draw.php @@ -130,7 +130,15 @@ function generateChart($today,$mode,$hours=0,$dateInput){ $date_array=array('year'=>$year,'month'=>$month,'day'=>$day); $summary=$db->select('summary','*',$date_array,'ORDER BY id DESC'); - if($summary===false ||isset($_GET['totalforce'])){ + $recentSummary=true; + # uncomment to activate rebuild + #foreach($types as $tmp){ + # if($tmp=$types[1]){ + # continue; + # } + # $recentSummary=($summary[0][$tmp.'-min-time'] > 0) && $recentSummary; + #} + if($summary===false ||isset($_GET['totalforce']) || ! $recentSummary){ //stats are not in db, generate new, also redraw graph $forceRedraw=true; $db->delete('summary',$date_array);//avoid multiple (outdated) entries