summaryrefslogtreecommitdiffstats
path: root/modules-available/syslog
diff options
context:
space:
mode:
authorSimon Rettberg2017-11-15 15:16:51 +0100
committerSimon Rettberg2017-11-15 15:16:51 +0100
commit9f7e2c4c794495f2a32410fd373cc313e0b0d4cf (patch)
treec81fa0c81ace880a9ae0801a0a647f867f3607e0 /modules-available/syslog
parent[dozmod] Improve location & exam mode detection (diff)
downloadslx-admin-9f7e2c4c794495f2a32410fd373cc313e0b0d4cf.tar.gz
slx-admin-9f7e2c4c794495f2a32410fd373cc313e0b0d4cf.tar.xz
slx-admin-9f7e2c4c794495f2a32410fd373cc313e0b0d4cf.zip
[statistics&syslog] Fix possible cron delete query overflow
Diffstat (limited to 'modules-available/syslog')
-rw-r--r--modules-available/syslog/hooks/cron.inc.php5
1 files changed, 4 insertions, 1 deletions
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 @@
<?php
if (mt_rand(1, 10) === 1) {
- Database::exec("DELETE FROM clientlog WHERE (UNIX_TIMESTAMP() - dateline) > 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