diff options
author | Yorhel <git@yorhel.nl> | 2010-11-01 08:24:54 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2010-11-01 08:24:54 +0100 |
commit | 7821739b6f57b5ba5f02bff2054a8afcbc118b1f (patch) | |
tree | 26094655ab58416d19446babc6f57d4572d0ba68 | |
parent | 80b74b70f27783702793d71712e78d8dde20268d (diff) |
Multi::Maintenance: Automatically remove read notifications after a month
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | lib/Multi/Maintenance.pm | 11 |
2 files changed, 10 insertions, 2 deletions
@@ -7,6 +7,7 @@ - Display friendly message in the VN edit scr tab when no release is known - Added 1024x576 and 1280x800 screen resolutions - Added more comparison VNs for the length field + - Automatically remove read notifications after a month - Bugfix: only redirect VN search to VN page if page=1 - Bugfix: remove duplicate votes when merging tags (fixes a 500) - Bugfix: Multi::Anime: don't crash when anidb returns an invalid or empty year 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 # |