Set lastget based on what the RSS feed contained, and not when we last checked it...
authorMagnus Hagander <magnus@hagander.net>
Mon, 20 Oct 2008 12:38:09 +0000 (12:38 +0000)
committerMagnus Hagander <magnus@hagander.net>
Mon, 20 Oct 2008 12:38:09 +0000 (12:38 +0000)
will fix cases where the time being different between server and planet caused blogs not to update.

aggregator.py

index 7bb9f39dedcdb0f0aba5d643c87562315a141531..fcfcc26e43e53d1388b8058605e2ca10e92d26d7 100755 (executable)
@@ -48,8 +48,9 @@ class Aggregator:
                        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})