Expire jobs if context is canceled

This commit is contained in:
Ettore Di Giacinto
2025-03-27 00:13:26 +01:00
committed by GitHub
parent 319caf8e91
commit 6ace4ab60d

View File

@@ -391,6 +391,13 @@ func (a *Agent) processUserInputs(job *types.Job, role string, conv Messages) Me
} }
func (a *Agent) consumeJob(job *types.Job, role string) { func (a *Agent) consumeJob(job *types.Job, role string) {
if err := job.GetContext().Err(); err != nil {
job.Result.Finish("expired"))
return
}
a.Lock() a.Lock()
paused := a.pause paused := a.pause
a.Unlock() a.Unlock()