Fixed total days counter to show valid projection on the first day too

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2020-03-14 09:29:10 +01:00
parent 679e71ff4f
commit c34e3ca641

View File

@ -2,7 +2,7 @@
class ControllerHealthWorker extends Controller { class ControllerHealthWorker extends Controller {
private $error = array(); private $error = [];
public function index(){ public function index(){
@ -72,6 +72,10 @@ class ControllerHealthWorker extends Controller {
$oldest_record_timestamp = $this->model_health_health->get_oldest_record_ts(); $oldest_record_timestamp = $this->model_health_health->get_oldest_record_ts();
$total_number_days = round( (time() - $this->model_health_health->get_first_email_arrival_ts()) / 86400 ); $total_number_days = round( (time() - $this->model_health_health->get_first_email_arrival_ts()) / 86400 );
if($total_number_days == 0) {
$total_number_days = 1;
}
$this->data['archive_size'] = nice_size($archivesizeraw, ' '); $this->data['archive_size'] = nice_size($archivesizeraw, ' ');
$this->data['archive_stored_size'] = nice_size($archivestoredsizeraw, ' '); $this->data['archive_stored_size'] = nice_size($archivestoredsizeraw, ' ');