-
Notifications
You must be signed in to change notification settings - Fork 63
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
Convert the duration to a float #497
Conversation
Thread#join used to accept duration objects but not since ruby 3/rails 6.1 See also ManageIQ/manageiq-providers-vmware#832
Checked commit jrafanie@4ddd1ee with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint |
@@ -31,7 +31,7 @@ def stop!(join_limit = 10.seconds) | |||
|
|||
finish.make_true | |||
watch&.finish rescue nil | |||
thread&.join(join_limit) | |||
thread&.join(join_limit.to_f) |
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.
Can you also change the incoming default parameter to just 10.0
? This way we're not needlessly creating a duration only to convert it. We still need the .to_f, in case the incoming parameter is not a float.
def stop!(join_limit = 10.0) # 10 seconds
Backported to
|
Convert the duration to a float (cherry picked from commit 1371d53)
Thread#join used to accept duration objects but not since ruby 3/rails 6.1
See also ManageIQ/manageiq-providers-vmware#832