minor fix

This commit is contained in:
云风
2013-07-23 14:39:38 +08:00
parent 39126c120f
commit e564406695

View File

@@ -20,8 +20,7 @@ local meta = {
function redis.connect(dbname) function redis.connect(dbname)
local db_conf = name[dbname] local db_conf = name[dbname]
local fd = socket.open(db_conf.host, db_conf.port or 6379) local fd = assert(socket.open(db_conf.host, db_conf.port or 6379))
assert(fd)
local r = setmetatable( { __handle = fd, __mode = false }, meta ) local r = setmetatable( { __handle = fd, __mode = false }, meta )
if db_conf.db ~= nil then if db_conf.db ~= nil then
r:select(db_conf.db) r:select(db_conf.db)