bugfix: auth before connected

This commit is contained in:
Cloud Wu
2014-03-24 11:14:39 +08:00
parent 90c947047c
commit 20db82dc97
3 changed files with 66 additions and 46 deletions

View File

@@ -89,6 +89,8 @@ function redis.connect(dbname)
port = db_conf.port or 6379,
auth = redis_login(db_conf.auth, db_conf.db),
}
-- try connect first
channel:connect()
return setmetatable( { channel }, meta )
end
@@ -180,6 +182,8 @@ function redis.watch(dbname)
}
obj.__sock = channel
-- try connect first
channel:connect()
return setmetatable( obj, watchmeta )
end