builder: fix concurrent map write

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 5ad981640f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Tonis Tiigi 2020-04-03 15:33:15 -07:00 committed by Sebastiaan van Stijn
parent 0df114a8f8
commit f34a5b5af0
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 2 additions and 0 deletions

View File

@ -241,7 +241,9 @@ func (b *Builder) Build(ctx context.Context, opt backend.BuildConfig) (*builder.
}
defer func() {
b.mu.Lock()
delete(b.jobs, buildID)
b.mu.Unlock()
}()
}