Skip to content

Commit 312f96a

Browse files
authored
Merge pull request #521 from ZYecho/fix-check
fix check for timeout
2 parents e34e276 + 98ba606 commit 312f96a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/custompluginmonitor/plugin/plugin.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ func (p *Plugin) run(rule cpmtypes.CustomRule) (exitStatus cpmtypes.Status, outp
175175
go func() {
176176
select {
177177
case <-ctx.Done():
178+
if ctx.Err() == context.Canceled {
179+
return
180+
}
178181
glog.Errorf("Error in running plugin timeout %q", rule.Path)
179182
if cmd.Process == nil || cmd.Process.Pid == 0 {
180183
glog.Errorf("Error in cmd.Process check %q", rule.Path)

0 commit comments

Comments
 (0)