提交 baf21803 编写于 作者: P peterq

fix demo: host进程6分钟强制关闭容器

上级 13dd38a8
......@@ -173,6 +173,16 @@ func (h *Holder) startIns() {
h.vncAddr = addr
h.vncAddrCond.Broadcast() // 通知等待链接的代理
}()
// 超过6分强制结束进程
exited := make(chan bool)
defer close(exited)
go func() {
select {
case <-time.After(6 * time.Minute):
dockerP.Process.Kill()
case <-exited:
}
}()
dockerP.Wait()
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册