diff util.py @ 35:aaec263f07ca

Feeds manage the point in time when the next update should happen. FeedUpdater only updates feeds that are due.
author Dirk Olmes <dirk@xanthippe.ping.de>
date Wed, 05 May 2010 03:07:59 +0200
parents 5813e3c10f14
children 22214d79ed41
line wrap: on
line diff
--- a/util.py	Wed May 05 02:14:05 2010 +0200
+++ b/util.py	Wed May 05 03:07:59 2010 +0200
@@ -1,5 +1,6 @@
 
 from ConfigParser import ConfigParser
+from datetime import datetime, timedelta
 from Feed import Feed
 import logging
 import socket
@@ -30,3 +31,8 @@
         session.add(feed)
     file.close()
     session.commit()
+
+def forceUpdateAllFeeds(session=None):
+    for feed in Feed.all(session):
+        feed.next_update = datetime.now() - timedelta(minutes=1)
+    session.commit()