mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 09:36:49 +03:00
This reverts commit ebcb8d5310
.
This commit is contained in:
parent
dffa612134
commit
72c155d8f4
|
@ -2,7 +2,6 @@
|
||||||
Provides various throttling policies.
|
Provides various throttling policies.
|
||||||
"""
|
"""
|
||||||
import time
|
import time
|
||||||
from collections import deque
|
|
||||||
|
|
||||||
from django.core.cache import cache as default_cache
|
from django.core.cache import cache as default_cache
|
||||||
from django.core.exceptions import ImproperlyConfigured
|
from django.core.exceptions import ImproperlyConfigured
|
||||||
|
@ -121,7 +120,7 @@ class SimpleRateThrottle(BaseThrottle):
|
||||||
if self.key is None:
|
if self.key is None:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
self.history = self.cache.get(self.key, deque())
|
self.history = self.cache.get(self.key, [])
|
||||||
self.now = self.timer()
|
self.now = self.timer()
|
||||||
|
|
||||||
# Drop any requests from the history which have now passed the
|
# Drop any requests from the history which have now passed the
|
||||||
|
|
Loading…
Reference in New Issue
Block a user