Commit f0858357 authored by Hiro's avatar Hiro 🏄
Browse files

Reset limit if test address

parent 1b67ec28
......@@ -13,6 +13,7 @@
"consumer_secret": "",
"access_key": "",
"access_secret": "",
"test_hid" = "",
"twitter_handle": "get_tor",
"twitter_messages_endpoint": "https://api.twitter.com/1.1/direct_messages/events/list.json",
"twitter_new_message_endpoint": "https://api.twitter.com/1.1/direct_messages/events/new.json"
......
......@@ -205,9 +205,14 @@ class EmailParser(object):
hid = hashlib.sha256(request['id'].encode('utf-8'))
# check limits first
num_requests = yield conn.get_num_requests(
id=hid.hexdigest(), service=request_service
)
num_requests = limit
if hid.hexdigest() == self.settings.get('test_hid'):
num_requests = 1
else:
num_requests = yield conn.get_num_requests(
id=hid.hexdigest(), service=request_service
)
if num_requests[0][0] < email_requests_limit:
return 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment