mirror of
https://github.com/unraid/webgui.git
synced 2026-03-06 00:18:57 -06:00
Prevent "unavailable" as first entry in parity history
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user