Mercurial > hg > Feedworm
diff backend/couchdb/Feed.py @ 144:74217db92993
updating feeds on the couchdb backend works now
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Wed, 24 Aug 2011 11:54:06 +0200 |
parents | 2cd30af937fa |
children | b290e29a94b5 |
line wrap: on
line diff
--- a/backend/couchdb/Feed.py Wed Aug 24 11:04:09 2011 +0200 +++ b/backend/couchdb/Feed.py Wed Aug 24 11:54:06 2011 +0200 @@ -1,5 +1,5 @@ -from datetime import datetime +from datetime import datetime, timedelta DATE_FORMAT = "%Y-%m-%d %H:%M:%S" @@ -20,6 +20,12 @@ delta = datetime.now() - updateDate return delta.total_seconds() > self._updateIntervalInSeconds() + def incrementedUpdateDate(self): + updateDate = self._nextUpdateDate() + updateInterval = self._updateIntervalInSeconds() + delta = timedelta(seconds=updateInterval) + return updateDate + delta + def _nextUpdateDate(self): nextUpdateString = self.next_update return datetime.strptime(nextUpdateString, DATE_FORMAT)