使用 TokenBucket 机制限制用户恶意提交代码

This commit is contained in:
virusdefender
2016-01-17 14:51:14 +08:00
parent 17ed05cb4c
commit 2097698560
3 changed files with 117 additions and 1 deletions

View File

@@ -185,3 +185,8 @@ TEST_CASE_DIR = os.path.join(BASE_DIR, 'test_case/')
IMAGE_UPLOAD_DIR = os.path.join(BASE_DIR, 'upload/')
# 用于限制用户恶意提交大量代码
TOKEN_BUCKET_DEFAULT_CAPACITY = 50
# 单位:每分钟
TOKEN_BUCKET_FILL_RATE = 2