diff options
Diffstat (limited to 'pkg/process/state.go')
-rw-r--r-- | pkg/process/state.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/process/state.go b/pkg/process/state.go index 652ec77c..bfc3a287 100644 --- a/pkg/process/state.go +++ b/pkg/process/state.go @@ -32,20 +32,20 @@ type State struct { } // WorkerProcessState creates new worker state definition. -func WorkerProcessState(w worker.BaseProcess) (State, error) { +func WorkerProcessState(w worker.BaseProcess) (*State, error) { const op = errors.Op("worker_process_state") p, _ := process.NewProcess(int32(w.Pid())) i, err := p.MemoryInfo() if err != nil { - return State{}, errors.E(op, err) + return nil, errors.E(op, err) } percent, err := p.CPUPercent() if err != nil { - return State{}, err + return nil, err } - return State{ + return &State{ CPUPercent: percent, Pid: int(w.Pid()), Status: w.State().String(), |