diff --git a/core/code/bench.go b/core/code/bench.go index f979d64a..4e22b3b8 100644 --- a/core/code/bench.go +++ b/core/code/bench.go @@ -5,7 +5,7 @@ import ( ice "github.com/shylinux/icebergs" kit "github.com/shylinux/toolkits" - "github.com/shylinux/toolkits/log" + "github.com/shylinux/toolkits/logs" "github.com/shylinux/toolkits/util/bench" "github.com/shylinux/toolkits/util/bench/redis" diff --git a/data.go b/data.go index 68b34a21..4bd60dae 100644 --- a/data.go +++ b/data.go @@ -10,7 +10,7 @@ func (m *Message) Richs(key string, chain interface{}, raw interface{}, cb inter if cache == nil { return nil } - return miss.Richs(m.Confm("miss", nil), kit.Keys(key, chain), cache, raw, cb) + return miss.Richs(kit.Keys(key, chain), cache, raw, cb) } func (m *Message) Rich(key string, chain interface{}, data interface{}) string { cache := m.Confm(key, chain) @@ -18,7 +18,7 @@ func (m *Message) Rich(key string, chain interface{}, data interface{}) string { cache = map[string]interface{}{} m.Confv(key, chain, cache) } - return miss.Rich(m.Confm("miss", nil), kit.Keys(key, chain), cache, data) + return miss.Rich(kit.Keys(key, chain), cache, data) } func (m *Message) Grow(key string, chain interface{}, data interface{}) int { cache := m.Confm(key, chain) @@ -26,14 +26,14 @@ func (m *Message) Grow(key string, chain interface{}, data interface{}) int { cache = map[string]interface{}{} m.Confv(key, chain, cache) } - return miss.Grow(m.Confm("miss", nil), kit.Keys(key, chain), cache, data) + return miss.Grow(kit.Keys(key, chain), cache, data) } func (m *Message) Grows(key string, chain interface{}, match string, value string, cb interface{}) map[string]interface{} { cache := m.Confm(key, chain) if cache == nil { return nil } - return miss.Grows(m.Confm("miss", nil), kit.Keys(key, chain), cache, + return miss.Grows(kit.Keys(key, chain), cache, kit.Int(kit.Select("0", m.Option("cache.offend"))), kit.Int(kit.Select("10", m.Option("cache.limit"))), match, value, cb) diff --git a/init.go b/init.go index e0b4bb22..4727700c 100644 --- a/init.go +++ b/init.go @@ -3,7 +3,7 @@ package ice import ( kit "github.com/shylinux/toolkits" "github.com/shylinux/toolkits/conf" - "github.com/shylinux/toolkits/log" + "github.com/shylinux/toolkits/logs" "github.com/shylinux/toolkits/miss" "github.com/shylinux/toolkits/task" @@ -82,12 +82,6 @@ var Index = &Context{Name: "ice", Help: "冰山模块", "", }, }}, - "miss": {Value: kit.Dict( - kit.MDB_STORE, "var/data", - kit.MDB_FSIZE, "200000", - kit.MDB_LIMIT, "110", - kit.MDB_LEAST, "100", - )}, "task": {Value: kit.Dict( kit.MDB_STORE, "var/data", kit.MDB_LIMIT, "110", @@ -155,10 +149,9 @@ func Run(arg ...string) string { arg = append(arg, "web.space", "connect", "self") } - conf := conf.New(nil) - task.Init(conf, 10) - miss.Init(conf) - log.Init(conf) + log.Init(conf.Sub("log")) + miss.Init(conf.Sub("miss")) + task.Init(conf.Sub("task")) frame := &Frame{} Index.root = Index diff --git a/logs.go b/logs.go index ae420130..02caa1c9 100644 --- a/logs.go +++ b/logs.go @@ -2,7 +2,7 @@ package ice import ( "github.com/shylinux/toolkits" - "github.com/shylinux/toolkits/log" + "github.com/shylinux/toolkits/logs" "fmt" "runtime"