Permalink
Browse files

Authenticate before selecting database. Fixes #9.

  • Loading branch information...
1 parent 4f1d24b commit 72b0bc16436b886313733f2aaa003f919761b908 @dgraham dgraham committed Nov 17, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/em-hiredis/client.rb
View
4 lib/em-hiredis/client.rb
@@ -40,8 +40,8 @@ def connect
@connection.on(:connected) do
@connected = true
- select(@db) if @db
auth(@password) if @password
+ select(@db) if @db
@subs.each { |s| method_missing(:subscribe, s) }
@psubs.each { |s| method_missing(:psubscribe, s) }
@@ -149,7 +149,7 @@ def info(&blk)
end
method_missing(:info, &hash_processor)
end
-
+
def close_connection
@closing_connection = true
@connection.close_connection_after_writing

0 comments on commit 72b0bc1

Please sign in to comment.