summaryrefslogtreecommitdiff
path: root/plugins/informer/rpc.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-06-02 20:56:49 +0300
committerValery Piashchynski <[email protected]>2021-06-02 20:56:49 +0300
commit6ccc3bb5e90073f579794c2d306ec01590afea05 (patch)
tree7b253c586135c00deebff245133b0b4a3ca798eb /plugins/informer/rpc.go
parenta99c14abb333c10a9142cd2f178e001f1b1726fb (diff)
- Return nil if there are no workers in the requested plugin
Signed-off-by: Valery Piashchynski <[email protected]>
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