remove redis config file, use table directly

This commit is contained in:
Cloud Wu
2014-04-21 15:08:10 +08:00
parent 5db65a68a8
commit 72d565dd22
9 changed files with 10 additions and 477 deletions

View File

@@ -1,9 +1,6 @@
local skynet = require "skynet"
local socket = require "socket"
local socketchannel = require "socketchannel"
local config = require "config"
local redis_conf = skynet.getenv "redis"
local name = config (redis_conf)
local table = table
local string = string
@@ -83,8 +80,7 @@ local function redis_login(auth, db)
end
end
function redis.connect(dbname)
local db_conf = name[dbname]
function redis.connect(db_conf)
local channel = socketchannel.channel {
host = db_conf.host,
port = db_conf.port or 6379,
@@ -170,8 +166,7 @@ local function watch_login(obj, auth)
end
end
function redis.watch(dbname)
local db_conf = name[dbname]
function redis.watch(db_conf)
local obj = {
__subscribe = {},
__psubscribe = {},