Skip to content

Commit

Permalink
Fix: keep the last invoked task alive even when it triggered drop cache
Browse files Browse the repository at this point in the history
  • Loading branch information
hugy718 committed Apr 9, 2024
1 parent 25d6f2c commit ac1757e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions task_executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,10 @@ func (meca *MecaExecutor) handleOneRequest(req *MecaRequestHandle) {
return
}
log.Printf("task with config %v added: %v ", req.taskCfg, h.task)
// if cleared cache, we add back the reference
if retryDueToResourceShortage > 0 {
meca.tracker.add(taskId, h.task)
}
go func() {
defer req.Done()
req.output, req.err = h.task.Execute(req.ctx, req.input)
Expand Down

0 comments on commit ac1757e

Please sign in to comment.