회수 버그 수정

This commit is contained in:
2023-05-30 16:51:23 +09:00
parent 9b9c3eaa4d
commit cff643310b

View File

@ -16,7 +16,6 @@ import (
"repositories.action2quare.com/ayo/gocommon/logger" "repositories.action2quare.com/ayo/gocommon/logger"
"repositories.action2quare.com/ayo/houston/shared" "repositories.action2quare.com/ayo/houston/shared"
"repositories.action2quare.com/ayo/houston/shared/protos"
"golang.org/x/text/encoding/korean" "golang.org/x/text/encoding/korean"
@ -214,13 +213,11 @@ func (hc *houstonClient) withdraw(req *shared.WithdrawRequest) error {
if fd != nil { if fd != nil {
if fd.IsDir() { if fd.IsDir() {
for _, running := range hc.childProcs { for _, running := range hc.childProcs {
if running.name == req.Name && running.version == req.Version { if running.name == req.Name && (len(req.Version) == 0 || running.version == req.Version) {
// 회수하려는 버전이 돌고 있다 // 회수하려는 버전이 돌고 있다
if running.state != protos.ProcessState_Stopped {
return fmt.Errorf("withdraw failed. %s@%s is still running", req.Name, req.Version) return fmt.Errorf("withdraw failed. %s@%s is still running", req.Name, req.Version)
} }
} }
}
return os.RemoveAll(path.Join(req.Name, req.Version)) return os.RemoveAll(path.Join(req.Name, req.Version))
} }