summaryrefslogtreecommitdiff
path: root/process_state.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-11-09 15:11:10 +0300
committerGitHub <[email protected]>2020-11-09 15:11:10 +0300
commit0874bcb2f6b284a940ba4f3507eb8c4619c27868 (patch)
treec99d15624cd080cad22b7c8fb7d4714b2dc124fb /process_state.go
parent9fbe7726dd55cfedda724b7644e1b6bf7c1a6cb4 (diff)
parentf218dcbd7e55d9ad1df8336e2331cdaa62d9ded3 (diff)
Merge pull request #390 from spiral/feature/switch_to_spiral_errorsv2.0.0-alpha17
Feature/switch to spiral errors
Diffstat (limited to 'process_state.go')
-rwxr-xr-xprocess_state.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/process_state.go b/process_state.go
index 1a4c4d65..1291a904 100755
--- a/process_state.go
+++ b/process_state.go
@@ -2,6 +2,7 @@ package roadrunner
import (
"github.com/shirou/gopsutil/process"
+ "github.com/spiral/errors"
)
// ProcessState provides information about specific worker.
@@ -25,10 +26,11 @@ type ProcessState struct {
// WorkerProcessState creates new worker state definition.
func WorkerProcessState(w WorkerBase) (ProcessState, error) {
+ const op = errors.Op("worker_process state")
p, _ := process.NewProcess(int32(w.Pid()))
i, err := p.MemoryInfo()
if err != nil {
- return ProcessState{}, err
+ return ProcessState{}, errors.E(op, err)
}
return ProcessState{