try connect only once at first time

This commit is contained in:
Cloud Wu
2014-04-22 16:18:49 +08:00
parent 08c511160f
commit b6c208cf51
4 changed files with 14 additions and 13 deletions

View File

@@ -86,8 +86,8 @@ function redis.connect(db_conf)
port = db_conf.port or 6379,
auth = redis_login(db_conf.auth, db_conf.db),
}
-- try connect first
channel:connect()
-- try connect first only once
channel:connect(true)
return setmetatable( { channel }, meta )
end
@@ -178,8 +178,8 @@ function redis.watch(db_conf)
}
obj.__sock = channel
-- try connect first
channel:connect()
-- try connect first only once
channel:connect(true)
return setmetatable( obj, watchmeta )
end