프로세스 재시작 요청 추가

This commit is contained in:
2023-06-26 11:26:57 +09:00
parent 3d3020f827
commit 06b390815c
4 changed files with 124 additions and 64 deletions

View File

@ -328,26 +328,18 @@ func (os *operationServer) RestartProcess(d RestartProcessRequest) {
return false
})
if len(d.hostnames) > 0 {
// hostname만 재시작
var final []*hostWithChan
conv := make(map[string]bool)
for _, hn := range d.hostnames {
conv[hn] = true
}
for _, t := range targets {
if _, ok := conv[t.Hostname]; ok {
final = append(final, t)
}
}
targets = final
if len(d.hostnames) != 1 {
return
}
// hostname만 재시작
for _, t := range targets {
t.opChan <- &opdef{
operation: shared.Restart,
args: d,
if t.Hostname == d.hostnames[0] {
t.opChan <- &opdef{
operation: shared.Restart,
args: d,
}
return
}
}
}