Prevent "unavailable" as first entry in parity history

This commit is contained in:
bergware
2016-07-12 07:51:19 +02:00
parent 75eb604aa8
commit 73a69d8f40
2 changed files with 2 additions and 2 deletions

View File

@@ -337,7 +337,7 @@ case 'parity':
$status = $var['sbSyncExit'];
$speed = ($status==0) ? my_scale($var['mdResyncSize']*1024/$duration,$unit,1)." $unit/s" : "Unavailable";
$year = date('Y',$var['sbSynced2']);
file_put_contents($log,"$year $timestamp|$duration|$speed|$status\n",FILE_APPEND);
if ($status==0||file_exists($log)) file_put_contents($log,"$year $timestamp|$duration|$speed|$status\n",FILE_APPEND);
}
break;
}

View File

@@ -82,7 +82,7 @@ function read_write_parity_log($epoch,$duration,$speed,$status) {
if (empty($line)) {
$year = date('Y',$epoch);
$line = "$year $timestamp|$duration|$speed|$status";
file_put_contents($log,"$line\n",FILE_APPEND);
if ($status==0||file_exists($log)) file_put_contents($log,"$line\n",FILE_APPEND);
}
return $line;
}