diff options
Diffstat (limited to 'plugins/informer/rpc.go')
-rw-r--r-- | plugins/informer/rpc.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/informer/rpc.go b/plugins/informer/rpc.go index 3738b619..478d3227 100644 --- a/plugins/informer/rpc.go +++ b/plugins/informer/rpc.go @@ -1,6 +1,7 @@ package informer import ( + "github.com/spiral/roadrunner/v2/pkg/state/job" "github.com/spiral/roadrunner/v2/pkg/state/process" ) @@ -10,7 +11,7 @@ type rpc struct { // WorkerList contains list of workers. type WorkerList struct { - // Workers is list of workers. + // Workers are list of workers. Workers []*process.State `json:"workers"` } @@ -29,7 +30,6 @@ func (rpc *rpc) List(_ bool, list *[]string) error { func (rpc *rpc) Workers(service string, list *WorkerList) error { workers := rpc.srv.Workers(service) if workers == nil { - list = nil return nil } @@ -39,6 +39,11 @@ func (rpc *rpc) Workers(service string, list *WorkerList) error { return nil } +func (rpc *rpc) Jobs(service string, out *[]*job.State) error { + *out = rpc.srv.Jobs(service) + return nil +} + // sort.Sort func (w *WorkerList) Len() int { |