Skip to content

Commit

Permalink
solver: make sure job id cleared after build
Browse files Browse the repository at this point in the history
Signed-off-by: Tonis Tiigi <[email protected]>
  • Loading branch information
tonistiigi committed Oct 26, 2020
1 parent 212a0b1 commit cac0b68
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions solver/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ type Job struct {
pw progress.Writer
span opentracing.Span
values sync.Map
id string

progressCloser func()
SessionID string
Expand Down Expand Up @@ -429,6 +430,7 @@ func (jl *Solver) NewJob(id string) (*Job, error) {
pw: pw,
progressCloser: progressCloser,
span: (&opentracing.NoopTracer{}).StartSpan(""),
id: id,
}
jl.jobs[id] = j

Expand Down Expand Up @@ -513,6 +515,8 @@ func (j *Job) Discard() error {
}
st.mu.Unlock()
}

delete(j.list.jobs, j.id)
return nil
}

Expand Down

0 comments on commit cac0b68

Please sign in to comment.