mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-11-04 14:49:58 +08:00
disable ip throttling
This commit is contained in:
parent
29f75a011b
commit
83b81bf14b
@ -24,11 +24,11 @@ class SubmissionAPI(APIView):
|
|||||||
if not can_consume:
|
if not can_consume:
|
||||||
return "Please wait %d seconds" % (int(wait))
|
return "Please wait %d seconds" % (int(wait))
|
||||||
|
|
||||||
ip_bucket = TokenBucket(key=request.session["ip"],
|
# ip_bucket = TokenBucket(key=request.session["ip"],
|
||||||
redis_conn=cache, **SysOptions.throttling["ip"])
|
# redis_conn=cache, **SysOptions.throttling["ip"])
|
||||||
can_consume, wait = ip_bucket.consume()
|
# can_consume, wait = ip_bucket.consume()
|
||||||
if not can_consume:
|
# if not can_consume:
|
||||||
return "Captcha is required"
|
# return "Captcha is required"
|
||||||
|
|
||||||
@validate_serializer(CreateSubmissionSerializer)
|
@validate_serializer(CreateSubmissionSerializer)
|
||||||
@login_required
|
@login_required
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user