Commit e4f5781e authored by Jesse Norell's avatar Jesse Norell

fix db quota messages

parent e8f8b1f1
......@@ -95,12 +95,12 @@ class cronjob_monitor_database_size extends cronjob {
if(!is_numeric($quota)) continue;
if($quota < 1 || $quota > $data[$i]['size']) {
print $rec['database_name'] . ' does not exceed quota qize: ' . $quota . ' > ' . $data[$i]['size'] . "\n";
print 'database ' . $rec['database_name'] . ' size does not exceed quota: ' . $quota . ' (quota) > ' . $data[$i]['size'] . " (used)\n";
if($rec['quota_exceeded'] == 'y') {
$app->dbmaster->datalogUpdate('web_database', array('quota_exceeded' => 'n'), 'database_id', $rec['database_id']);
}
} elseif($rec['quota_exceeded'] == 'n') {
print $rec['database_name'] . ' exceeds quota qize: ' . $quota . ' < ' . $data[$i]['size'] . "\n";
print 'database ' . $rec['database_name'] . ' size exceeds quota: ' . $quota . ' (quota) < ' . $data[$i]['size'] . " (used)\n";
$app->dbmaster->datalogUpdate('web_database', array('quota_exceeded' => 'y'), 'database_id', $rec['database_id']);
}
}
......
......@@ -634,12 +634,12 @@ class db
$result = $this->_query("SELECT SUM(data_length+index_length) FROM information_schema.TABLES WHERE table_schema='".$this->escape($database_name)."'");
if(!$result) {
$this->_sqlerror('Unable to get the database-size for ' . $database_name);
$this->_sqlerror('Unable to determine the size of database ' . $database_name);
return;
}
$database_size = $result->getAsRow();
$result->free();
return $database_size[0];
return $database_size[0] ? $database_size[0] : 0;
}
//** Function to fill the datalog with a full differential record.
......
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