bisakhmondal commented on a change in pull request #2054:
URL: https://github.com/apache/apisix-dashboard/pull/2054#discussion_r709909555



##########
File path: api/internal/utils/pid.go
##########
@@ -18,19 +18,62 @@
 package utils
 
 import (
+       "bytes"
        "fmt"
        "io/ioutil"
        "os"
+       "runtime"
        "strconv"
+       "syscall"
+       "time"
+
+       "github.com/pkg/errors"
 )
 
 // WritePID write pid to the given file path.
 func WritePID(filepath string, forceStart bool) error {
-       if pid, err := ReadPID(filepath); err == nil {
-               if !forceStart {
-                       return fmt.Errorf("Instance of Manager API maybe 
running with a pid %d. If not, please run Manager API with '-f' or '--force' 
flag\n", pid)
+       pidStatAction := func() error {
+               pid, err := ReadPID(filepath)
+               if err != nil {
+                       return nil

Review comment:
       Done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to