summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-03-17 21:45:41 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2011-03-17 21:45:41 +0100
commit722cbca65f37a7e265a9e45d320e8319cd51bfa8 (patch)
treefa92c2a0da88ad8c6add6235439a1c3c4819fe78
parent0dceb1518718a1f4c694c9c8b00379a418fa5cb2 (diff)
tracking: Remove stale packages.
-rw-r--r--modules/tracking.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/tracking.py b/modules/tracking.py
index 3533ee9..43435a1 100644
--- a/modules/tracking.py
+++ b/modules/tracking.py
@@ -341,6 +341,11 @@ class Module:
session.add(package)
if announce:
self.irc.msg(target, msg)
+ elif package.last != None and package.last < datetime.datetime.utcnow() - datetime.timedelta(hours = 24*30):
+ msg = '%s: Removing stale package \002%s\002%s' % (consignment.nick, consignment.code, label)
+ self.irc.msg(target, msg.encode('utf-8'))
+ session.delete(package)
+ removed = True
if removed and len(consignment.packages) == 0:
msg = '%s: \002%s\002%s is no longer being tracked' % (consignment.nick, consignment.code, label)
self.irc.msg(target, msg.encode('utf-8'))