mirror of
https://github.com/unraid/webgui.git
synced 2026-03-20 20:02:44 -05:00
Merge pull request #53 from bergware/master
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;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ function preset($disk) {
|
||||
|
||||
@unlink('/boot/config/smart-one.cfg');
|
||||
@unlink('/boot/config/smart-all.cfg');
|
||||
@unlink('/boot/config/plugins/dynamix/monitor.ini');
|
||||
if ($_POST['preset']) {
|
||||
$disks = parse_ini_file('/var/local/emhttp/disks.ini',true);
|
||||
$disks = array_filter($disks,'preset');
|
||||
|
||||
@@ -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