diff options
author | Valery Piashchynski <[email protected]> | 2021-08-17 23:27:37 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-08-17 23:27:37 +0300 |
commit | 65a70f5d15fb0a1b1f787ff7f06b3a299dab0f96 (patch) | |
tree | c6c3e8f4b5952c4e389804da38fea0e03b2cd111 /plugins/resetter/rpc.go | |
parent | 064d375e3671135226cb3bc70be057339b23f26f (diff) |
Update Resetter plugin, remove old and unused code
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/resetter/rpc.go')
-rw-r--r-- | plugins/resetter/rpc.go | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/plugins/resetter/rpc.go b/plugins/resetter/rpc.go index 69c955b0..79171b5c 100644 --- a/plugins/resetter/rpc.go +++ b/plugins/resetter/rpc.go @@ -1,30 +1,29 @@ package resetter -import "github.com/spiral/roadrunner/v2/plugins/logger" +import "github.com/spiral/errors" type rpc struct { srv *Plugin - log logger.Logger } // List all resettable plugins. func (rpc *rpc) List(_ bool, list *[]string) error { - rpc.log.Debug("started List method") *list = make([]string, 0) for name := range rpc.srv.registry { *list = append(*list, name) } - rpc.log.Debug("services list", "services", *list) - - rpc.log.Debug("finished List method") return nil } // Reset named plugin. func (rpc *rpc) Reset(service string, done *bool) error { - rpc.log.Debug("started Reset method for the service", "service", service) - defer rpc.log.Debug("finished Reset method for the service", "service", service) + const op = errors.Op("resetter_rpc_reset") + err := rpc.srv.Reset(service) + if err != nil { + *done = false + return errors.E(op, err) + } *done = true - return rpc.srv.Reset(service) + return nil } |