From 9f7e2c4c794495f2a32410fd373cc313e0b0d4cf Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 15 Nov 2017 15:16:51 +0100 Subject: [statistics&syslog] Fix possible cron delete query overflow --- modules-available/syslog/hooks/cron.inc.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'modules-available/syslog') diff --git a/modules-available/syslog/hooks/cron.inc.php b/modules-available/syslog/hooks/cron.inc.php index c796675f..bae882a9 100644 --- a/modules-available/syslog/hooks/cron.inc.php +++ b/modules-available/syslog/hooks/cron.inc.php @@ -1,5 +1,8 @@ 86400 * 190"); + Database::exec("DELETE FROM clientlog WHERE (UNIX_TIMESTAMP() - 86400 * 190) > dateline"); + if (mt_rand(1, 100) === 1) { + Database::exec("OPTIMIZE TABLE clientlog"); + } } \ No newline at end of file -- cgit v1.2.3-55-g7522