diff options
author | Valery Piashchynski <[email protected]> | 2021-04-18 23:51:27 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-04-18 23:51:27 +0300 |
commit | 4931146022a644a69e73f241e094966bdb5cb51f (patch) | |
tree | 19591af9a6a6d226640a680c2196143122324882 /plugins/service/plugin.go | |
parent | f5210c3f0739c03e9284c857d65dde3d97f3d84d (diff) |
- Add test binaries/exe for the Linux/Windows
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/service/plugin.go')
-rw-r--r-- | plugins/service/plugin.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/service/plugin.go b/plugins/service/plugin.go index bc72dbaf..60ed46c3 100644 --- a/plugins/service/plugin.go +++ b/plugins/service/plugin.go @@ -43,6 +43,10 @@ func (service *Plugin) Serve() chan error { // start processing go func() { + // lock here, because Stop command might be invoked during the Serve + service.Lock() + defer service.Unlock() + service.processes = make([]*Process, 0, len(service.cfg.Services)) // for the every service for k := range service.cfg.Services { @@ -60,11 +64,9 @@ func (service *Plugin) Serve() chan error { } } - service.Lock() for i := 0; i < len(service.processes); i++ { service.processes[i].start() } - service.Unlock() }() return errCh |