-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skip slowlogs if there is an error #9147
Conversation
@@ -449,7 +449,8 @@ def _check_slowlog(self): | |||
|
|||
# Get all slowlog entries | |||
|
|||
slowlogs = conn.slowlog_get(max_slow_entries) | |||
# https://github.com/andymccurdy/redis-py/issues/1238 | |||
slowlogs = conn.slowlog_get(max_slow_entries, decode_responses=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean to use parse_slowlog_get
? https://github.com/andymccurdy/redis-py/blob/master/redis/client.py#L401
Otherwise the param is num
for slowlog_get: https://github.com/andymccurdy/redis-py/blob/master/redis/client.py#L1517-L1527
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yes, indeed, this methods uses the connection options, and 'decode_responses' is false by default https://github.com/andymccurdy/redis-py/blob/master/redis/client.py#L744.
It would also not help in any case since both options would produce the same result
>>> ' '.join([1, 2, 3])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: sequence item 0: expected str instance, int found
>>> b' '.join([1, 2, 3])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: sequence item 0: expected a bytes-like object, int found
In the linked issue the error is str found
while here is int found
Mitigates #8716
Caused by redis/redis-py#1475