Skip to content

Send PING command to redis to check if it is alive - #79

Open
ip75 wants to merge 2 commits into
electric-sheep-co:masterfrom
ip75:master
Open

ip75 wants to merge 2 commits into
electric-sheep-co:masterfrom
ip75:master

Conversation

@ip75

@ip75 ip75 commented Dec 16, 2023

Copy link
Copy Markdown

Returns the server's liveliness response.

@ip75
ip75 requested a review from rpj as a code owner December 16, 2023 22:42
Comment thread Redis.cpp

bool Redis::ping()
{
TRCMD_EXPECTOK("PING", "OK");

@rpj rpj Dec 23, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional arguments to TRCMD_EXPECTOK are passed through as arguments to the Redis command ("PING"), so in this case it would send "PING OK". If you want to send a bare "PING" without any argument, you'd just want TRCMD_EXPECTOK("PING"); Is sending with the "OK" argument what you were intending? It's hard to tell without seeing a test for this command...

... which leads me to my next request: please implement a test for this in the integration tests. The pattern is pretty simple and straightforward but please ask if you have trouble.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've read documentation for PING command. Argument in PING command is returned for the successful response.

Ok. I'll implement test... Reply a comment when it will be done.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've read documentation for PING command. Argument in PING command is returned for the successful response.

Yeah and that's why I was asking, it's completely fine if you wanted to send "OK" and then expect that response in the test, but like I said I wasn't sure without seeing some usage of it. 😊

Thank you! 🙇

@rpj

rpj commented Dec 23, 2023

Copy link
Copy Markdown
Member

@ip75 Thank you so much for taking the time & effort to get this fixed up! It's nearly there, I just have a couple more requests to make sure this PR is up to our project's standards. Appreciate your effort, let's get this one across the line! 🏁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants