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
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
def getArticles(self, type, limit): redisService = RedisService(self.log) mark = redisService.getArticlesMark() service = MongoService(self.log) articles = service.getArticles(type, limit, mark) return articles
def loadFactors(self): service = RedisService(self.log) factors = service.getFactors() return factors
def getMark(): service = RedisService() redisMark = service.getArticlesMark() if redisMark==None or redisMark=="": redisMark = "A" return redisMark