From 8caece0aead593182533a25be583a2fbc18b96ec Mon Sep 17 00:00:00 2001 From: jerome Date: Wed, 26 Mar 2014 00:19:14 +0100 Subject: [PATCH] Limite the number of records in the database to 30 days --- src/includes/functions.inc.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/includes/functions.inc.php b/src/includes/functions.inc.php index 1be0093d..3efae21e 100755 --- a/src/includes/functions.inc.php +++ b/src/includes/functions.inc.php @@ -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); } /**