|
@@ -56,41 +56,42 @@ class AuthorLimit(object):
|
|
|
"""
|
|
|
限制账号, 服务长沙四名同学
|
|
|
"""
|
|
|
- if self.mode == "author":
|
|
|
- tag = self.find_tag(user_id)
|
|
|
- if tag:
|
|
|
- AliyunLogger.logging(
|
|
|
- code="8807",
|
|
|
- platform=self.platform,
|
|
|
- mode=self.mode,
|
|
|
- env="prod",
|
|
|
- message="找到个人账号,{}".format(tag)
|
|
|
- )
|
|
|
- R = RedisClient()
|
|
|
- if R.connect():
|
|
|
- tag_count = R.select(tag)
|
|
|
- if tag_count:
|
|
|
- tag_count = int(tag_count.decode("utf-8"))
|
|
|
- if tag_count <= 300:
|
|
|
- tag_count += 1
|
|
|
- expire_seconds = generate_expire_time()
|
|
|
- R.insert(
|
|
|
- key=tag, value=tag_count, expire_time=expire_seconds
|
|
|
- )
|
|
|
- return True
|
|
|
- else:
|
|
|
- # 报警
|
|
|
- return False
|
|
|
- else:
|
|
|
- tag_count = 1
|
|
|
- expire_seconds = generate_expire_time()
|
|
|
- R.insert(
|
|
|
- key=tag, value=tag_count, expire_time=expire_seconds
|
|
|
- )
|
|
|
- return True
|
|
|
- else:
|
|
|
- return True
|
|
|
- else:
|
|
|
- return True
|
|
|
- else:
|
|
|
- return True
|
|
|
+ return True
|
|
|
+ # if self.mode == "author":
|
|
|
+ # tag = self.find_tag(user_id)
|
|
|
+ # if tag:
|
|
|
+ # AliyunLogger.logging(
|
|
|
+ # code="8807",
|
|
|
+ # platform=self.platform,
|
|
|
+ # mode=self.mode,
|
|
|
+ # env="prod",
|
|
|
+ # message="找到个人账号,{}".format(tag)
|
|
|
+ # )
|
|
|
+ # R = RedisClient()
|
|
|
+ # if R.connect():
|
|
|
+ # tag_count = R.select(tag)
|
|
|
+ # if tag_count:
|
|
|
+ # tag_count = int(tag_count.decode("utf-8"))
|
|
|
+ # if tag_count <= 300:
|
|
|
+ # tag_count += 1
|
|
|
+ # expire_seconds = generate_expire_time()
|
|
|
+ # R.insert(
|
|
|
+ # key=tag, value=tag_count, expire_time=expire_seconds
|
|
|
+ # )
|
|
|
+ # return True
|
|
|
+ # else:
|
|
|
+ # # 报警
|
|
|
+ # return False
|
|
|
+ # else:
|
|
|
+ # tag_count = 1
|
|
|
+ # expire_seconds = generate_expire_time()
|
|
|
+ # R.insert(
|
|
|
+ # key=tag, value=tag_count, expire_time=expire_seconds
|
|
|
+ # )
|
|
|
+ # return True
|
|
|
+ # else:
|
|
|
+ # return True
|
|
|
+ # else:
|
|
|
+ # return True
|
|
|
+ # else:
|
|
|
+ # return True
|