-
Notifications
You must be signed in to change notification settings - Fork 96
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
Add the option to set the client name #157
base: master
Are you sure you want to change the base?
Conversation
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.
Is there a way to add a test for this?
aredis/connection.py
Outdated
@@ -442,6 +443,11 @@ async def on_connect(self): | |||
await self.send_command('SELECT', self.db) | |||
if nativestr(await self.read_response()) != 'OK': | |||
raise ConnectionError('Invalid Database') | |||
|
|||
if self.client_name: |
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.
if self.client_name: | |
if self.client_name is not None: |
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.
Changed.
aredis/connection.py
Outdated
@@ -367,7 +367,7 @@ class BaseConnection: | |||
def __init__(self, retry_on_timeout=False, stream_timeout=None, | |||
parser_class=DefaultParser, reader_read_size=65535, | |||
encoding='utf-8', decode_responses=False, | |||
*, loop=None): | |||
*, loop=None, client_name=None): |
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.
IMO client_name
should be defined before loop
as it is application configuration unlike loop
, but this is very subjective.
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.
Changed.
Added by setting the client_name on the connection in the tests. Also rebased on master. |
@Fogapod Any chance of reviewing this again? |
@dovreshef yeah, looks good now, but I'm not a maintainer. I just left 2 comments |
I see. Thanks. @NoneGG Can this be merged? Reviewed? |
Hi @dovreshef -- just wanted to let you know that my org has recently forked Also wanted to thank you for implementing the redis v5 username & password support, as that made some of my testing a bit easier :) |
Derived from NoneGG/aredis#157
Derived from NoneGG/aredis#157
No description provided.