Skip to content
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 TIME command as Redis #1394

Merged
merged 6 commits into from
Apr 19, 2023
Merged

Conversation

enjoy-binbin
Copy link
Member

This PR adds the TIME command. The TIME command returns the current
server time as a two items lists: a Unix timestamp and the amount of
microseconds already elapsed in the current second.

Example:

127.0.0.1:6666> time
1) "1681828105"
2) "810037"

This closes #1393

This PR adds the TIME command. The TIME command returns the current
server time as a two items lists: a Unix timestamp and the amount of
microseconds already elapsed in the current second.

Example:
```
127.0.0.1:6666> time
1) "1681828105"
2) "810037"
```

This closes apache#1393
@enjoy-binbin
Copy link
Member Author

having trouble with how to add a time test case...

@git-hulk
Copy link
Member

git-hulk commented Apr 18, 2023

having trouble with how to add a time test case...

@enjoy-binbin Do you mean that you don't know how to check if the time command is correct? If yes, we can only check if the seconds field is in the range of [now-2, now+2] by using require.WithinRange.

And if you don't know where to add the test case, can just imitate the ping command test case.

@enjoy-binbin
Copy link
Member Author

@git-hulk thanks. i got it now

Co-authored-by: hulk <hulk.website@gmail.com>
Copy link
Contributor

@torwig torwig left a comment

Choose a reason for hiding this comment

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

LGTM

@git-hulk
Copy link
Member

Thanks all, merging...

@git-hulk git-hulk merged commit d2aa7b5 into apache:unstable Apr 19, 2023
@enjoy-binbin enjoy-binbin deleted the time_command branch April 19, 2023 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement a TIME command from Redis
3 participants