Commit 971c80f3 authored by Tibo's avatar Tibo

Fix division by 0

parent a94a5fc1
Pipeline #2072 failed with stage
in 37 seconds
......@@ -16,7 +16,11 @@ class DiskEvolution extends \App\AbstractSensor {
$delta = new Delta();
$delta->filesystem = $partition->filesystem;
$delta->delta = $partition->used - $newAndOld[1][$key]->used;
$delta->timeUntillFull = ($partition->blocks - $partition->used) / $delta->delta * $timeDifference;
if ($delta->delta == 0) {
$delta->timeUntillFull = PHP_INT_MAX;
} else {
$delta->timeUntillFull = ($partition->blocks - $partition->used) / $delta->delta * $timeDifference;
}
$deltas[] = $delta;
}
return $deltas;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment