summaryrefslogtreecommitdiff
path: root/plugins/informer/rpc.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-06-02 21:23:42 +0300
committerGitHub <[email protected]>2021-06-02 21:23:42 +0300
commit9c01e7ab1548e1416598b702d63866fa6dc5707b (patch)
tree35056e2a44cc8427b857399a9eb154c15986d22e /plugins/informer/rpc.go
parenta99c14abb333c10a9142cd2f178e001f1b1726fb (diff)
parent42c0d32eb2e28fee3d084d887552b1ebafdd66c6 (diff)
#699 fix(bug): return `nil` if there are no workers in the requested pluginv2.3.0-beta.1
#699 fix(bug): return `nil` if there are no workers in the requested plugin
Diffstat (limited to 'plugins/informer/rpc.go')
-rw-r--r--plugins/informer/rpc.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/informer/rpc.go b/plugins/informer/rpc.go
index 8955af92..3925ef64 100644
--- a/plugins/informer/rpc.go
+++ b/plugins/informer/rpc.go
@@ -16,7 +16,7 @@ type WorkerList struct {
// List all resettable services.
func (rpc *rpc) List(_ bool, list *[]string) error {
- *list = make([]string, 0, len(rpc.srv.registry))
+ *list = make([]string, 0, len(rpc.srv.withWorkers))
// append all plugin names to the output result
for name := range rpc.srv.available {
@@ -27,9 +27,10 @@ func (rpc *rpc) List(_ bool, list *[]string) error {
// Workers state of a given service.
func (rpc *rpc) Workers(service string, list *WorkerList) error {
- workers, err := rpc.srv.Workers(service)
- if err != nil {
- return err
+ workers := rpc.srv.Workers(service)
+ if workers == nil {
+ list = nil
+ return nil
}
// write actual processes