完善contest权限控制

This commit is contained in:
zema1
2017-10-27 18:36:29 +08:00
parent b694000ab9
commit 728373a5ff
19 changed files with 219 additions and 162 deletions

View File

@@ -31,11 +31,10 @@ class TokenBucket:
class BucketController:
def __init__(self, user_id, redis_conn, default_capacity):
self.user_id = user_id
def __init__(self, factor, redis_conn, default_capacity):
self.default_capacity = default_capacity
self.redis = redis_conn
self.key = "bucket_" + str(self.user_id)
self.key = "bucket_" + str(factor)
@property
def last_capacity(self):