Ignore "no such process" error (#1686)
* Cleanup how status is updated for service. Ignore "no such process" error as it could be that the pid died * add nice error log to record process error exit
This commit is contained in:
@@ -3,6 +3,7 @@ package kubernetes
|
||||
import (
|
||||
"encoding/json"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/micro/go-micro/v2/logger"
|
||||
"github.com/micro/go-micro/v2/runtime"
|
||||
@@ -185,8 +186,10 @@ func (s *service) Update(k client.Client, opts ...client.UpdateOption) error {
|
||||
}
|
||||
|
||||
func (s *service) Status(status string, err error) {
|
||||
s.Metadata["lastStatusUpdate"] = time.Now().Format(time.RFC3339)
|
||||
if err == nil {
|
||||
s.Metadata["status"] = status
|
||||
delete(s.Metadata, "error")
|
||||
return
|
||||
}
|
||||
s.Metadata["status"] = "error"
|
||||
|
Reference in New Issue
Block a user