summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--lib/Multi/Maintenance.pm11
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index f2b21f11..5b13dae1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,7 +10,7 @@ git - ?
- Only tagmods can create top-level tags
- Notification system (still only used for PMs)
- Removed the ?l10n= paremeter
- - Keep track of when a session has last been used
+ - Remove sessions that haven't been used for more than a month
2.10 - 2010-01-10
- VN score on tag pages use plain averages instead of bayesian rating
diff --git a/lib/Multi/Maintenance.pm b/lib/Multi/Maintenance.pm
index 864239dd..be267aba 100644
--- a/lib/Multi/Maintenance.pm
+++ b/lib/Multi/Maintenance.pm
@@ -17,12 +17,12 @@ sub spawn {
package_states => [
$p => [qw|
_start shutdown set_daily daily set_monthly monthly log_stats
- vncache_inc tagcache vnpopularity vnrating cleangraphs
+ vncache_inc tagcache vnpopularity vnrating cleangraphs cleansessions
vncache_full usercache statscache logrotate
|],
],
heap => {
- daily => [qw|vncache_inc tagcache vnpopularity vnrating cleangraphs|],
+ daily => [qw|vncache_inc tagcache vnpopularity vnrating cleangraphs cleansessions|],
monthly => [qw|vncache_full usercache statscache logrotate|],
@_,
},
@@ -151,6 +151,13 @@ sub cleangraphs {
}
+sub cleansessions {
+ $_[KERNEL]->post(pg => do =>
+ q|DELETE FROM sessions WHERE lastused < NOW()-'1 month'::interval|,
+ undef, 'log_stats', 'cleansessions');
+}
+
+
#
# M O N T H L Y J O B S
#