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

Parse the timeout parameter as double in the blocking command #1518

Merged
merged 7 commits into from
Jun 27, 2023

Conversation

Yangsx-1
Copy link
Contributor

Close #1503
Convert timeout parameter in commands blpop/brpop, bzpopmin/max and bzmpop from int to double.

@Yangsx-1
Copy link
Contributor Author

@torwig There is something wrong in CI with Darwin Clang, what can i do to deal with it?

@torwig
Copy link
Contributor

torwig commented Jun 24, 2023

@Yangsx-1 You can try casting timeout_microsecond to int by using static_cast(timeout_microsecond) because according to the warning, the second argument should be int not int64.

@torwig
Copy link
Contributor

torwig commented Jun 24, 2023

@Yangsx-1 According to this:

struct timeval {
   time_t      tv_sec;   // Number of whole seconds of elapsed time
   long int    tv_usec;  // Number of microseconds of rest of elapsed time minus tv_sec. Always less than one million
};

The number of microseconds is always less than one million so int is OK. Or what is your concern?

@Yangsx-1
Copy link
Contributor Author

@Yangsx-1 According to this:

struct timeval {
   time_t      tv_sec;   // Number of whole seconds of elapsed time
   long int    tv_usec;  // Number of microseconds of rest of elapsed time minus tv_sec. Always less than one million
};

The number of microseconds is always less than one million so int is OK. Or what is your concern?

Oh, i understand. There is no need to worry about overflow!

torwig
torwig previously approved these changes Jun 24, 2023
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.
@Yangsx-1 Thank you for your contribution.

@git-hulk git-hulk changed the title convert timeout parameter from int to double Parse the timeout parameter as double in the blocking command Jun 25, 2023
git-hulk
git-hulk previously approved these changes Jun 25, 2023
@Yangsx-1 Yangsx-1 dismissed stale reviews from torwig and git-hulk via a55e972 June 26, 2023 10:37
@git-hulk
Copy link
Member

Thanks all, merging...

@git-hulk git-hulk merged commit 2abf0ad into apache:unstable Jun 27, 2023
@Yangsx-1 Yangsx-1 deleted the timeout-float branch June 27, 2023 14:54
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.

Convert the timeout parameter from an integer to a double value
4 participants