From 3ade1216154c58427f904dd65232befca2412857 Mon Sep 17 00:00:00 2001 From: overflowerror Date: Mon, 5 Aug 2024 21:07:08 +0200 Subject: [PATCH] feat: Add housekeeping bin + slight restructure of cron jobs --- bin/cron/daily.php | 5 +++++ bin/cron/housekeeping.php | 12 ++++++++++++ bin/cron/updateCache.php | 3 +++ bin/cron/updateData.php | 4 +++- bin/cron/weekly.php | 3 +++ lib/housekeeping.php | 19 +++++++++++++++++++ 6 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 bin/cron/daily.php create mode 100644 bin/cron/housekeeping.php create mode 100644 bin/cron/weekly.php create mode 100644 lib/housekeeping.php diff --git a/bin/cron/daily.php b/bin/cron/daily.php new file mode 100644 index 0000000..d5bb461 --- /dev/null +++ b/bin/cron/daily.php @@ -0,0 +1,5 @@ +exec("DELETE FROM mm_audit_log WHERE time < (CURRENT_TIMESTAMP - INTERVAL '6 months')"); +} + + +function removeOldSessionIDs() { + global $pdo; + $pdo->exec(<<