A -s stop wait for 5 second

This commit is contained in:
zhenorzz 2021-12-18 14:14:56 +08:00
parent 0b67c71823
commit ecb5acfc2e

View File

@ -253,7 +253,7 @@ func handleClientSignal() {
log.Fatal("handle stop, ", err.Error())
}
println("App is trying to shutdown, wait for a minute")
for {
for i := 0; i < 5; i++ {
time.Sleep(time.Second)
if _, err := os.Stat(pidFile); errors.Is(err, os.ErrNotExist) {
println("Success")