Commit 55f1bfe5 authored by vicotor's avatar vicotor

add retry for callback

parent ca6661f5
......@@ -216,11 +216,14 @@ func (wm *WorkerManager) doCallback(hook string, response *odysseus.TaskResponse
} else {
log.WithField("task-id", response.TaskId).Debug("marshal task response")
}
for i := 0; i < 5; i++ {
err = utils.Post(hook, d)
if err != nil {
log.WithError(err).Error("post task result failed")
log.WithField("try", i).WithError(err).Error("post task result failed")
} else {
log.WithField("task-id", response.TaskId).Debug("post task result")
break
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment