Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Hiro
GetTor
Commits
4515c62f
Commit
4515c62f
authored
Oct 18, 2019
by
Hiro
🏄
Browse files
Log checks temporarily
parent
356f68a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
gettor/parse/email.py
View file @
4515c62f
...
...
@@ -152,7 +152,14 @@ class EmailParser(object):
def
too_many_requests
(
self
,
hid
,
num_requests
,
limit
):
if
hid
==
self
.
settings
.
get
(
'test_hid'
):
test_hid
=
self
.
settings
.
get
(
'test_hid'
)
log
.
msg
(
"test_hid {}"
.
format
(
test_hid
),
system
=
"email parser"
)
log
.
msg
(
"hid {}"
.
format
(
hid
),
system
=
"email parser"
)
if
hid
==
test_hid
:
return
False
elif
num_requests
<
limit
:
return
False
...
...
@@ -245,8 +252,6 @@ class EmailParser(object):
)
log
.
msg
(
"check: {}"
.
format
(
check
),
system
=
"email parser"
)
log
.
msg
(
"hid: {}"
.
format
(
hid
),
system
=
"email parser"
)
log
.
msg
(
"request['id']: {}"
.
format
(
request
[
'id'
]),
system
=
"email parser"
)
if
check
:
log
.
msg
(
...
...
tests/test_email_service.py
View file @
4515c62f
...
...
@@ -63,7 +63,6 @@ class EmailServiceTests(unittest.TestCase):
def
test_too_many_request_exclude
(
self
):
ep
=
conftests
.
EmailParser
(
self
.
settings
,
"gettor@torproject.org"
)
hid
=
"80d7054da0d3826563c7babb5453e18f3e42f932e562c5ab0434aec9df7b0625"
request_service
=
"osx"
limit
=
self
.
settings
.
get
(
"email_requests_limit"
)
num_requests
=
300
check
=
ep
.
too_many_requests
(
hid
,
num_requests
,
limit
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment