Delete 4 week old notifications on start

This commit is contained in:
Ruud committed 2012-06-27 16:34:51 +02:00
1 parent 4206c2b0dd
commit 41a3a9011f
1 file changed
+8
@@ -54,6 +54,14 @@ class CoreNotifier(Notification):
addNonBlockApiView('notification.listener', (self.addListener, self.removeListener))
addApiView('notification.listener', self.listener)
addEvent('app.load', self.clean)
def clean(self):
db = get_session()
db.query(Notif).filter(Notif.added <= (int(time.time()) - 2419200)).delete()
db.commit()
def markAsRead(self):