diff options
author | Valery Piashchynski <[email protected]> | 2021-08-31 14:59:28 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-08-31 14:59:28 +0300 |
commit | 31cf040029eb0b26278e4a9948cbc1aba77ed58b (patch) | |
tree | 884dd2991acf12826752632b8321410e7cc923ce /plugins/jobs | |
parent | 2f44878a7eac71d7b81e66246b46c615a95892d7 (diff) |
Naming: service -> plugin
Fix bug with survived workers in the debug mode
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/jobs')
-rw-r--r-- | plugins/jobs/plugin.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/jobs/plugin.go b/plugins/jobs/plugin.go index 83b302ee..3f3fa196 100644 --- a/plugins/jobs/plugin.go +++ b/plugins/jobs/plugin.go @@ -342,10 +342,6 @@ func (p *Plugin) Stop() error { cancel() } - p.Lock() - p.workersPool.Destroy(context.Background()) - p.Unlock() - // this function can block forever, but we don't care, because we might have a chance to exit from the pollers, // but if not, this is not a problem at all. // The main target is to stop the drivers @@ -358,6 +354,11 @@ func (p *Plugin) Stop() error { // just wait pollers for 5 seconds before exit time.Sleep(time.Second * 5) + + p.Lock() + p.workersPool.Destroy(context.Background()) + p.Unlock() + return nil } |