mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-24 18:30:11 +01:00
health stat fix
This commit is contained in:
parent
4e1a5cb4dd
commit
89ba24c86b
@ -66,8 +66,8 @@ class ControllerHealthWorker extends Controller {
|
||||
list($archivesizeraw, $this->data['counters']) = $this->model_stat_counter->get_counters();
|
||||
|
||||
$oldest_record_timestamp = $this->model_health_health->get_oldest_record_ts();
|
||||
$total_number_days = round( (time() - $oldest_record_timestamp) / 86400 );
|
||||
|
||||
$total_number_days = round( (time() - $this->model_health_health->get_first_email_arrival_ts()) / 86400 );
|
||||
|
||||
$this->data['archive_size'] = nice_size($archivesizeraw, ' ');
|
||||
|
||||
$this->data['prefix'] = '';
|
||||
|
@ -181,6 +181,15 @@ class ModelHealthHealth extends Model {
|
||||
}
|
||||
|
||||
|
||||
public function get_first_email_arrival_ts() {
|
||||
$query = $this->db->query("SELECT `arrived` FROM " . TABLE_META . " ORDER BY id ASC LIMIT 1");
|
||||
|
||||
if(isset($query->row)) { return $query->row['arrived']; }
|
||||
|
||||
return time();
|
||||
}
|
||||
|
||||
|
||||
public function get_sphinx_size($directory = DIR_SPHINX) {
|
||||
$dirSize=0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user