Permalink
Browse files

Set lastget based on what the RSS feed contained, and not when we las…

…t checked it. Hopefully this

will fix cases where the time being different between server and planet caused blogs not to update.
  • Loading branch information...
1 parent e1befe8 commit 584b3f57da4453d3b9274a3d57e7d4435542035b @mhagander committed Oct 20, 2008
Showing with 3 additions and 2 deletions.
  1. +3 −2 aggregator.py
View
@@ -48,8 +48,9 @@ def ParseFeed(self, feedinfo):
else:
guidisperma = True
self.StoreEntry(feedinfo[0], entry.id, entry.date, entry.link, guidisperma, entry.title, txt)
- self.db.cursor().execute('UPDATE planet.feeds SET lastget=%(lg)s WHERE id=%(feed)s', {'lg':parsestart, 'feed': feedinfo[0]})
-
+ self.db.cursor().execute("UPDATE planet.feeds SET lastget=COALESCE((SELECT max(dat) FROM planet.posts WHERE planet.posts.feed=planet.feeds.id),'2000-01-01') WHERE planet.feeds.id=%(feed)s", {'feed': feedinfo[0]})
+ #self.db.cursor().execute('UPDATE planet.feeds SET lastget=%(lg)s WHERE id=%(feed)s', {'lg':parsestart, 'feed': feedinfo[0]})
+
def StoreEntry(self, feedid, guid, date, link, guidisperma, title, txt):
c = self.db.cursor()
c.execute("SELECT id FROM planet.posts WHERE feed=%(feed)s AND guid=%(guid)s", {'feed':feedid, 'guid':guid})

0 comments on commit 584b3f5

Please sign in to comment.