diff options
author | Valery Piashchynski <[email protected]> | 2021-02-10 20:00:22 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-02-10 20:00:22 +0300 |
commit | ae3dd0c3672217be0b3fb4042ef650477fba108b (patch) | |
tree | da5b08308e5aff50a102f41e254ee3620d41550e /plugins/server/plugin.go | |
parent | da64d9fbab7d73e203e7dbbb9503f4d422feaab0 (diff) |
Rewrite container for the workers
Update tests
Diffstat (limited to 'plugins/server/plugin.go')
-rw-r--r-- | plugins/server/plugin.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/server/plugin.go b/plugins/server/plugin.go index 3fc77926..95e593b8 100644 --- a/plugins/server/plugin.go +++ b/plugins/server/plugin.go @@ -49,11 +49,6 @@ func (server *Plugin) Init(cfg config.Configurer, log logger.Logger) error { server.cfg.InitDefaults() server.log = log - server.factory, err = server.initFactory() - if err != nil { - return errors.E(op, err) - } - return nil } @@ -64,7 +59,14 @@ func (server *Plugin) Name() string { // Serve (Start) server plugin (just a mock here to satisfy interface) func (server *Plugin) Serve() chan error { + const op = errors.Op("server_plugin_serve") errCh := make(chan error, 1) + var err error + server.factory, err = server.initFactory() + if err != nil { + errCh <- errors.E(op, err) + return errCh + } return errCh } |