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

Fix bug with non-integer timeouts #6

Merged
merged 2 commits into from
Jul 6, 2014
Merged

Conversation

dcadenas
Copy link
Contributor

I didn't have to add tests for this as they were already failing.
Gracias!

@djanowski
Copy link
Collaborator

Use case?

@dcadenas
Copy link
Contributor Author

@djanowski it's not new behavior, it's just a fix

@dcadenas
Copy link
Contributor Author

This is caused because the timeout is interpreted as that only when it's a number: https://github.com/redis/redis-rb/blob/master/lib/redis.rb#L1115

@@ -1,7 +1,7 @@
require "nest"

module Ost
TIMEOUT = ENV["OST_TIMEOUT"] || 2
TIMEOUT = ENV["OST_TIMEOUT"].to_i || 2
Copy link

Choose a reason for hiding this comment

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

Shouldn't this be something like:

TIMEOUT = (ENV["OST_TIMEOUT"] || 2).to_i

If not, when not providing OST_TIMEOUT it'll be 0.

@dcadenas
Copy link
Contributor Author

@kitop good catch! I just changed it, thanks

soveran added a commit that referenced this pull request Jul 6, 2014
Fix bug with non-integer timeouts
@soveran soveran merged commit 5ba4f07 into soveran:master Jul 6, 2014
@soveran
Copy link
Owner

soveran commented Jul 6, 2014

@dcadenas Excellent, thanks!

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.

4 participants