-
Notifications
You must be signed in to change notification settings - Fork 14
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
Optimize ping() method #146
Comments
Maybe ping() method just use to test valkey server is alive or not, so there is no need to add extra message, but why use **kwargs to receive extra params since the default callback will occurs exception? Similar situations also include the time() method, they both use lambda expression as callback. |
Hi! Your proposal makes sense to me. But I'd rewrite
as
|
Would you like to make a PR? |
there is a problem using >>> data = {"message": None}
>>> data.get("message", "PONG") == None
True |
i will make a pr, thanks for your reply, i'll continue to fix real bugs in valkey-py and try to make it better. now i only read valkey's command methods, so my opinions may not be good or even wrong, but i will think more before asking questions. |
it was my fault to think that this issue was easy to fix, i didn't understand the code well enough. adding a message that would affect the callback of the cluster connection in ping. Although I found the callback code , I thought it was unnecessary to modify both, so I closed my pr. I will test more cases before creating a pr in the future. thanks again @aiven-sal |
No problem! |
ping() method in ManagementCommands
valkey-py/valkey/commands/core.py
Lines 1203 to 1209 in c490780
when i use ping() method in class ManagementCommands, i have some questions:
valkey-py/valkey/client.py
Lines 1079 to 1084 in c490780
Is there any historical reasons to do so? Now i do some changes for ping:
then we can try the new ping() method:
The text was updated successfully, but these errors were encountered: