summaryrefslogtreecommitdiff
path: root/plugins/service/plugin.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-04-18 23:51:27 +0300
committerValery Piashchynski <[email protected]>2021-04-18 23:51:27 +0300
commit4931146022a644a69e73f241e094966bdb5cb51f (patch)
tree19591af9a6a6d226640a680c2196143122324882 /plugins/service/plugin.go
parentf5210c3f0739c03e9284c857d65dde3d97f3d84d (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.go6
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