summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2010-11-01 08:24:54 +0100
committerYorhel <git@yorhel.nl>2010-11-01 08:24:54 +0100
commit7821739b6f57b5ba5f02bff2054a8afcbc118b1f (patch)
tree26094655ab58416d19446babc6f57d4572d0ba68 /lib
parent80b74b70f27783702793d71712e78d8dde20268d (diff)
Multi::Maintenance: Automatically remove read notifications after a month
Diffstat (limited to 'lib')
-rw-r--r--lib/Multi/Maintenance.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/Multi/Maintenance.pm b/lib/Multi/Maintenance.pm
index 497b160e..5b092d0a 100644
--- a/lib/Multi/Maintenance.pm
+++ b/lib/Multi/Maintenance.pm
@@ -18,13 +18,13 @@ sub spawn {
package_states => [
$p => [qw|
_start shutdown set_daily daily set_monthly monthly log_stats
- vncache_inc tagcache vnpopularity vnrating cleangraphs cleansessions
+ vncache_inc tagcache vnpopularity vnrating cleangraphs cleansessions cleannotifications
vncache_full usercache statscache logrotate
vnsearch_check vnsearch_gettitles vnsearch_update
|],
],
heap => {
- daily => [qw|vncache_inc tagcache vnpopularity vnrating cleangraphs cleansessions|],
+ daily => [qw|vncache_inc tagcache vnpopularity vnrating cleangraphs cleansessions cleannotifications|],
monthly => [qw|vncache_full usercache statscache logrotate|],
vnsearch_checkdelay => 3600,
@_,
@@ -163,6 +163,13 @@ sub cleansessions {
}
+sub cleannotifications {
+ $_[KERNEL]->post(pg => do =>
+ q|DELETE FROM notifications WHERE read < NOW()-'1 month'::interval|,
+ undef, 'log_stats', 'cleannotifications');
+}
+
+
#
# M O N T H L Y J O B S
#