summaryrefslogtreecommitdiff
path: root/lib/Multi/Maintenance.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Multi/Maintenance.pm')
-rw-r--r--lib/Multi/Maintenance.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Multi/Maintenance.pm b/lib/Multi/Maintenance.pm
index 23fb6db5..23e17fff 100644
--- a/lib/Multi/Maintenance.pm
+++ b/lib/Multi/Maintenance.pm
@@ -93,6 +93,8 @@ my %dailies = (
cleansessions => q|DELETE FROM sessions WHERE lastused < NOW()-'1 month'::interval|,
cleannotifications => q|DELETE FROM notifications WHERE read < NOW()-'1 month'::interval|,
+ cleannotifications2=> q|DELETE FROM notifications WHERE id IN (
+ SELECT id FROM (SELECT id, row_number() OVER (PARTITION BY uid ORDER BY id DESC) > 500 from notifications) AS x(id,del) WHERE x.del)|,
rmunconfirmusers => q|DELETE FROM users WHERE registered < NOW()-'1 week'::interval AND NOT email_confirmed|,
cleanthrottle => q|DELETE FROM login_throttle WHERE timeout < NOW()|,
);