Properly close channel when monitor exits.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu
2019-10-24 20:58:14 -07:00
parent 705cb01e0c
commit be7cc78aa0
9 changed files with 37 additions and 14 deletions

View File

@@ -55,6 +55,7 @@ func (p *Plugin) GetResultChan() <-chan cpmtypes.Result {
func (p *Plugin) Run() {
defer func() {
glog.Info("Stopping plugin execution")
close(p.resultChan)
p.tomb.Done()
}()