summaryrefslogtreecommitdiff
path: root/plugins/jobs/plugin.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jobs/plugin.go')
-rw-r--r--plugins/jobs/plugin.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/jobs/plugin.go b/plugins/jobs/plugin.go
index 61936db2..c9bba1c2 100644
--- a/plugins/jobs/plugin.go
+++ b/plugins/jobs/plugin.go
@@ -195,7 +195,7 @@ func (p *Plugin) Serve() chan error { //nolint:gocognit
for {
select {
case <-p.stopCh:
- p.log.Debug("------> job poller stopped <------")
+ p.log.Info("------> job poller stopped <------")
return
default:
// get prioritized JOB from the queue
@@ -240,6 +240,16 @@ func (p *Plugin) Serve() chan error { //nolint:gocognit
continue
}
+ // if response is nil or body is nil, just acknowledge the job
+ if resp == nil || resp.Body == nil {
+ p.putPayload(exec)
+ err = jb.Ack()
+ if err != nil {
+ p.log.Error("acknowledge error, job might be missed", "error", err)
+ continue
+ }
+ }
+
// handle the response protocol
err = handleResponse(resp.Body, jb, p.log)
if err != nil {