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

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

No files matched your search

+5
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