Skip to content

Commit

Permalink
Clean up when windows process stop (#807)
Browse files Browse the repository at this point in the history
Co-authored-by: hanpengfei01 <hanpengfei01@baidu.com>
  • Loading branch information
hannatao and hanpengfei01 committed Nov 21, 2023
1 parent e6e836d commit b0dd868
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions ami/native/native.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,17 +430,16 @@ func (impl *nativeImpl) DeleteApp(ns string, app v1.AppInfo) error {
var childs *[]ami.ProcessInfo
if runtime.GOOS == "windows" {
status, err := svc.Status()
if err != nil {
return errors.Trace(err)
}
if status == service.StatusRunning {
pid, err := svc.GetPid()
if err != nil {
impl.log.Warn("failed to get svc pid", log.Error(err))
}
childs, err = getChildProcessInfo(pid)
if err != nil {
impl.log.Warn("failed to get child pid", log.Error(err))
if err == nil {
if status == service.StatusRunning {
pid, err := svc.GetPid()
if err != nil {
impl.log.Warn("failed to get svc pid", log.Error(err))
}
childs, err = getChildProcessInfo(pid)
if err != nil {
impl.log.Warn("failed to get child pid", log.Error(err))
}
}
}
}
Expand Down

0 comments on commit b0dd868

Please sign in to comment.