1. Benoit Boissinot
  2. jorf2rss

Commits

Benoit Boissinot  committed beb0c9a

fix updating

  • Participants
  • Parent commits 7fb026e
  • Branches default

Comments (0)

Files changed (1)

File cron.py

View file
  • Ignore whitespace
         now = datetime.now()
         today = now.date()
         last_update = LastUpdate.get_or_insert("fetch", timestamp=now)
-        last = FeedArticle.all().fetch(1)
+        last = FeedArticle.all().order('-timestamp').fetch(1)
         if not last:
             for i in range(defaultfeed):
                 try:
                 newarticle(today)
             except Exception, err:
                 logging.info("Failed to fetch %s" % err)
-            self.last_update.timestamp = now
-            self.last_update.put()
+            last_update.timestamp = now
+            last_update.put()
+        self.response.out.write("OK\r\n")
 
 application = webapp.WSGIApplication(
                                      [('/update-jorf', UpdateHandler)],