Пример #1
0
  def _isFeedNew(self, feedItem):
    feedResUpdateTime = FeedResUpdateTime.get(self.feedRes.id) 
    isFeedUpdated = feedItem.isUpdated(feedResUpdateTime)
    notInCache = True
    if not Cache.isEmpty():
      notInCache = not Cache.isExist(feedItem)

    return isFeedUpdated and notInCache
Пример #2
0
 def test_fillCache(self):
   self.resOper.fillCache()
   self.assertLessEqual(0, Cache.size())
Пример #3
0
 def fillCache(self):
   self.getFeedResUpdateTime()
   for e in self.getFeeds(100):
     Cache.update(e)
Пример #4
0
 def _writeFeeds(self, feeds, table):
   sql = 'insert into {} (from_feed_id, title, link, time) values ({!r},{!r},{!r},{!r})'
   for feed in feeds:
     self.db.executeDML(sql.format(table, feed.fromFeedId, feed.title, feed.link, feed.pubDate))
     Cache.update(feed) #update cache when fetched new feed