Limite the number of records in the database to 30 days

This commit is contained in:
jerome 2014-03-26 00:19:14 +01:00
parent 2ddf2126ab
commit 8caece0aea
1 changed files with 5 additions and 0 deletions

View File

@ -187,6 +187,11 @@ function psm_log_uptime($server_id, $status, $latency) {
'latency' => $latency,
)
);
// Limite the number of records in the database to 30 days
$time = time() - (60 * 60 * 24 * 30);
$query = 'DELETE FROM ' . PSM_DB_PREFIX.'servers_uptime WHERE date < "' . date('Y-m-d 00:00:00', $time) . '"';
$db->query($query);
}
/**