Skip to content

Commit a115924

Browse files
committed
Bugfix: Incorrect SystemTimer warning message when run on Rubinius.
1 parent 9ac8b7c commit a115924

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/redis/connection/ruby.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,11 @@ def with_timeout(seconds, &block)
116116
end
117117

118118
rescue LoadError
119-
warn "WARNING: using the built-in Timeout class which is known to have issues when used for opening connections. Install the SystemTimer gem if you want to make sure the Redis client will not hang." unless RUBY_VERSION >= "1.9" || RUBY_PLATFORM =~ /java/
119+
if ! defined?(RUBY_ENGINE)
120+
# MRI 1.8, all other interpreters define RUBY_ENGINE, JRuby and
121+
# Rubinius should have no issues with timeout.
122+
warn "WARNING: using the built-in Timeout class which is known to have issues when used for opening connections. Install the SystemTimer gem if you want to make sure the Redis client will not hang."
123+
end
120124

121125
require "timeout"
122126

0 commit comments

Comments
 (0)