forked from x/icebergs
opt timeout
This commit is contained in:
parent
7dc0108151
commit
436e25f546
@ -118,7 +118,7 @@ func init() {
|
|||||||
ice.WEB_SPACE: {Name: "space", Help: "空间站", Value: kit.Data(kit.MDB_SHORT, kit.MDB_NAME,
|
ice.WEB_SPACE: {Name: "space", Help: "空间站", Value: kit.Data(kit.MDB_SHORT, kit.MDB_NAME,
|
||||||
"redial.a", 3000, "redial.b", 1000, "redial.c", 1000,
|
"redial.a", 3000, "redial.b", 1000, "redial.c", 1000,
|
||||||
"buffer.r", 4096, "buffer.w", 4096,
|
"buffer.r", 4096, "buffer.w", 4096,
|
||||||
"timeout.c", "30s",
|
"timeout.c", "180s",
|
||||||
)},
|
)},
|
||||||
},
|
},
|
||||||
Commands: map[string]*ice.Command{
|
Commands: map[string]*ice.Command{
|
||||||
|
5
exec.go
5
exec.go
@ -81,8 +81,9 @@ func (m *Message) Done() bool {
|
|||||||
}
|
}
|
||||||
func (m *Message) Call(sync bool, cb func(*Message) *Message) *Message {
|
func (m *Message) Call(sync bool, cb func(*Message) *Message) *Message {
|
||||||
wait := make(chan bool, 2)
|
wait := make(chan bool, 2)
|
||||||
t := time.AfterFunc(kit.Duration(kit.Select("10s", m.Option("timeout"))), func() {
|
p := kit.Select("10s", m.Option("timeout"))
|
||||||
m.Warn(true, "timeout %v", m.Detailv())
|
t := time.AfterFunc(kit.Duration(p), func() {
|
||||||
|
m.Warn(true, "%s timeout %v", p, m.Detailv())
|
||||||
wait <- false
|
wait <- false
|
||||||
m.Back(nil)
|
m.Back(nil)
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user