Skip to content

Commit

Permalink
Merge pull request #1752 from tonistiigi/discard-buildid
Browse files Browse the repository at this point in the history
solver: make sure job id cleared after build
  • Loading branch information
AkihiroSuda authored Oct 26, 2020
2 parents dec78e3 + cac0b68 commit 3d4fa3e
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 3d4fa3e

Please sign in to comment.