Skip to content

Instantly share code, notes, and snippets.

@abecciu
Created June 21, 2010 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abecciu/447439 to your computer and use it in GitHub Desktop.
Save abecciu/447439 to your computer and use it in GitHub Desktop.
diff --git a/lib/redis/client.rb b/lib/redis/client.rb
index 9f7ab94..9d8fcea 100644
--- a/lib/redis/client.rb
+++ b/lib/redis/client.rb
@@ -237,6 +237,8 @@ class Redis
end
def timeout=(timeout)
+ return if @sock.nil?
+
secs = Integer(timeout)
usecs = Integer((timeout - secs) * 1_000_000)
optval = [secs, usecs].pack("l_2")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment