1
0
forked from x/icebergs
This commit is contained in:
IT 老营长 @云轩领航-创始人 2023-03-22 18:12:52 +08:00
parent 2473f3cf3e
commit 82f59f190b
5 changed files with 9 additions and 9 deletions

View File

@ -15,15 +15,15 @@ func (f *Frame) Begin(m *ice.Message, arg ...string) ice.Server {
return f
}
func (f *Frame) Start(m *ice.Message, arg ...string) bool {
t := kit.Duration(m.Conf(TIMER, kit.Keym(TICK)))
enable := m.Conf(TIMER, kit.Keym("enable")) == ice.TRUE
t := kit.Duration(mdb.Conf(m, TIMER, kit.Keym(TICK)))
enable := mdb.Conf(m, TIMER, kit.Keym("enable")) == ice.TRUE
for {
select {
case <-time.Tick(t):
case &lt;-time.Tick(t):
if enable {
m.Cmd(TIMER, HAPPEN)
}
case s, ok := <-f.s:
case s, ok := &lt;-f.s:
if !ok {
return true
}

View File

@ -26,13 +26,13 @@ func (f *Frame) Begin(m *ice.Message, arg ...string) ice.Server {
return f
}
func (f *Frame) Start(m *ice.Message, arg ...string) bool {
m.Option("_lock", m.PrefixKey())
for {
select {
case l, ok := <-f.p:
if !ok {
return true
}
continue
for _, file := range []string{m.Conf(SHOW, kit.Keys(l.l, FILE)), BENCH} {
if file == "" {
continue

View File

@ -167,7 +167,7 @@ func StatusHashAction(arg ...Any) ice.Actions {
}, HashAction(arg...))
}
func ClearHashOnExitAction() ice.Actions {
return ice.MergeActions(ice.Actions{ice.CTX_EXIT: {Hand: func(m *ice.Message, arg ...string) { m.Conf("", HASH, "") }}})
return ice.MergeActions(ice.Actions{ice.CTX_EXIT: {Hand: func(m *ice.Message, arg ...string) { Conf(m, m.PrefixKey(), HASH, "") }}})
}
func HashKey(m *ice.Message) string {
@ -235,7 +235,7 @@ func HashSelects(m *ice.Message, arg ...string) *ice.Message {
return HashSelect(m, arg...)
}
func HashSelectValue(m *ice.Message, cb Any) *ice.Message {
m.OptionFields(m.Config(FIELD))
m.OptionFields(Config(m, FIELD))
defer RLock(m, m.PrefixKey(), "")()
Richs(m, m.PrefixKey(), nil, FOREACH, func(key string, value Map) { _mdb_select(m, cb, key, value, nil, nil) })
return m

View File

@ -37,6 +37,6 @@ func RenderAction(args ...ice.Any) ice.Actions {
})
}
}},
ice.CTX_EXIT: {Hand: func(m *ice.Message, arg ...string) { m.Conf("", HASH, "") }},
ice.CTX_EXIT: {Hand: func(m *ice.Message, arg ...string) { Conf(m, m.PrefixKey(), HASH, "") }},
})
}

View File

@ -527,7 +527,7 @@ func (m *Message) Confi(key string, sub string) int {
}
func (m *Message) Confv(arg ...Any) (val Any) {
if m.Spawn().Warn(Info.Important && m.Option("_lock") == "") {
m.Debug("what lock %s %s", m.PrefixKey(), m.FormatStack(1, 100))
m.Warn(true, "what unsafe lock", m.PrefixKey(), m.FormatStack(1, 100))
}
run := func(conf *Config) {
if len(arg) == 1 {