[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [gettor/master] Fix bug in email parser
commit e9ee80b15d11268b9190c87a71bb1631e64a7899
Author: hiro <hiro@xxxxxxxxxxxxxx>
Date: Wed Oct 16 12:43:07 2019 +0200
Fix bug in email parser
---
gettor/parse/email.py | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/gettor/parse/email.py b/gettor/parse/email.py
index 06f92c2..f1c7dc3 100644
--- a/gettor/parse/email.py
+++ b/gettor/parse/email.py
@@ -199,11 +199,7 @@ class EmailParser(object):
def check_num_requests(self, request_id, request_service, limit):
- now_str = datetime.now().strftime("%Y%m%d%H%M%S")
- dbname = self.settings.get("dbname")
- conn = SQLite3(dbname)
-
- hid = hashlib.sha256(request['id'].encode('utf-8'))
+ hid = hashlib.sha256(request_id.encode('utf-8'))
# check limits first
num_requests = limit
@@ -234,6 +230,9 @@ class EmailParser(object):
execution details.
"""
email_requests_limit = self.settings.get("email_requests_limit")
+ now_str = datetime.now().strftime("%Y%m%d%H%M%S")
+ dbname = self.settings.get("dbname")
+ conn = SQLite3(dbname)
if request["command"]:
log.msg(
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits