summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--lib/Multi/Maintenance.pm11
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 76c9bc54..0f4d0fce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
#