중지할 프로세스를 동시에 처리
This commit is contained in:
@ -22,6 +22,7 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"repositories.action2quare.com/ayo/gocommon"
|
||||
"repositories.action2quare.com/ayo/gocommon/logger"
|
||||
"repositories.action2quare.com/ayo/houston/shared"
|
||||
"repositories.action2quare.com/ayo/houston/shared/protos"
|
||||
@ -431,22 +432,14 @@ func NewClient(standalone bool) (HoustonClient, error) {
|
||||
id64, _ := strconv.ParseInt(idstr, 10, 0)
|
||||
id := int32(id64)
|
||||
|
||||
var killing *procmeta
|
||||
var remains []*procmeta
|
||||
for _, meta := range hc.childProcs {
|
||||
if meta.id == id {
|
||||
killing = meta
|
||||
} else {
|
||||
remains = append(remains, meta)
|
||||
hc.childProcs = gocommon.ShrinkSlice(hc.childProcs, func(e *procmeta) bool {
|
||||
if e.id == id {
|
||||
e.cmd.Wait()
|
||||
e.cmd.Process.Release()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
if killing != nil {
|
||||
killing.cmd.Wait()
|
||||
killing.cmd.Process.Release()
|
||||
}
|
||||
|
||||
hc.childProcs = remains
|
||||
return false
|
||||
})
|
||||
|
||||
op.Refresh(context.Background(), hc.makeOperationQueryRequest())
|
||||
}
|
||||
@ -523,7 +516,7 @@ func (hc *houstonClient) Start() {
|
||||
if client != nil {
|
||||
err := hc.checkOperation(client)
|
||||
if err != nil {
|
||||
logger.Println("hc.checkUpdate failed :", err)
|
||||
logger.Println("grpc.DialContext hc.checkOperation failed :", err)
|
||||
|
||||
client = nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user