def set_table(self, plan_id, value):
     try:
         redispool.hset("%s:%s" % (self.key, plan_id), "table", value)
         db_logger.debug("内容设定成功")
         return True
     except Exception as e:
         db_logger.error("内容设定失败,失败原因:" + repr(e))
         return False
 def set_time(self, plan_id):
     try:
         redispool.hset("%s:%s" % (
             self.key, plan_id), "time", datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
         db_logger.debug("内容设定成功")
         return True
     except Exception as e:
         db_logger.error("内容设定失败,失败原因:" + repr(e))
         return False
Exemplo n.º 3
0
 def set(self, role_id, value):
     try:
         redispool.hset(self.key, role_id, value)
         logmsg = "Redis值设定|" + self.key + "值设定成功"
         db_logger.debug(logmsg)
         return True
     except Exception as e:
         logmsg = "Redis值设定|" + self.key + "值设定失败,失败原因:" + repr(e)
         db_logger.error(logmsg)
         return False