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

Convert the duration to a float #497

Merged
merged 1 commit into from
Jun 26, 2023

Conversation

jrafanie
Copy link
Member

Thread#join used to accept duration objects but not since ruby 3/rails 6.1

See also ManageIQ/manageiq-providers-vmware#832

Thread#join used to accept duration objects but not since ruby 3/rails 6.1

See also ManageIQ/manageiq-providers-vmware#832
@miq-bot
Copy link
Member

miq-bot commented Jun 26, 2023

Checked commit jrafanie@4ddd1ee with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint
1 file checked, 0 offenses detected
Everything looks fine. ⭐

@agrare agrare merged commit 1371d53 into ManageIQ:master Jun 26, 2023
@@ -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)
Copy link
Member

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

@jrafanie jrafanie deleted the fix_join_with_duration branch June 26, 2023 15:56
@Fryguy
Copy link
Member

Fryguy commented Jun 28, 2023

Backported to petrosian in commit 51d0504.

commit 51d050413e54f22e4f9f292659b0b7ade211885a
Author: Adam Grare <adam@grare.com>
Date:   Mon Jun 26 11:38:58 2023 -0400

    Merge pull request #497 from jrafanie/fix_join_with_duration
    
    Convert the duration to a float
    
    (cherry picked from commit 1371d53a794a3c0aaea3a2614d37245a424d7e63)

Fryguy pushed a commit that referenced this pull request Jun 28, 2023
Convert the duration to a float

(cherry picked from commit 1371d53)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants