Skip to content

Commit b956476

Browse files
authored
Merge pull request #1215 from buildpacks/fix-spelling-1211
Polish #1211 - Add Concurrency support Signed-off-by: David Freilich <freilich.david@gmail.com>
2 parents dc17e64 + fab54a7 commit b956476

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

internal/registry/registry_cache.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,15 @@ func (r *Cache) CreateCache() error {
187187
return err
188188
}
189189

190-
return os.Rename(w.Filesystem.Root(), r.Root)
190+
err = os.Rename(w.Filesystem.Root(), r.Root)
191+
if err != nil {
192+
if err == os.ErrExist {
193+
// If pack is run concurrently, this action might have already occurred
194+
return nil
195+
}
196+
return err
197+
}
198+
return nil
191199
}
192200

193201
func (r *Cache) validateCache() error {

0 commit comments

Comments
 (0)