Пример #1
0
 def outputByRedis(self, articles):
     try:
         service = RedisService(self.log)
         return service.hsetArticles(articles)
     except Exception as e:
         self.log.printError("outputByRedis error: '%s'" %(e))
         return False  
Пример #2
0
 def outputFactors(self):
     try:
         service = RedisService(self.log)
         service.setFactors(self.factors)
         return True
     except Exception as e:
         self.log.printError("outputFactors error: '%s'" %(e))
         return False
Пример #3
0
 def getArticles(self, type, limit):
     redisService = RedisService(self.log)
     mark = redisService.getArticlesMark()
     service = MongoService(self.log)
     articles = service.getArticles(type, limit, mark)
     return articles
Пример #4
0
 def loadFactors(self):
     service = RedisService(self.log)
     factors = service.getFactors()
     return factors
Пример #5
0
def getMark():
    service = RedisService()
    redisMark = service.getArticlesMark()
    if redisMark==None or redisMark=="":
        redisMark = "A"
    return redisMark
Пример #6
0
 def getArticles(self, type, limit):
     redisService = RedisService(self.log)
     mark = redisService.getArticlesMark()
     service = MongoService(self.log)
     articles = service.getArticles(type, limit, mark)
     return articles