Skip to content

Commit

Permalink
fix: result race issue
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaomakuaiz committed Jun 3, 2024
1 parent 19efb29 commit 65599fb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,9 @@ func (w *Worker) processJobResult() {
w.result.Error++
}
if w.resultCh != nil {
w.result.Job = job
w.resultCh <- w.result
r := *w.result
r.Job = job
w.resultCh <- &r
}
}
}
Expand Down

0 comments on commit 65599fb

Please sign in to comment.