(ctx context.Context, desc ocispec.Descriptor)
| 726 | } |
| 727 | |
| 728 | func (u *Unpacker) lockBlobDescriptor(ctx context.Context, desc ocispec.Descriptor) (func(), error) { |
| 729 | key := u.makeBlobDescriptorKey(desc) |
| 730 | |
| 731 | if err := u.duplicationSuppressor.Lock(ctx, key); err != nil { |
| 732 | return nil, err |
| 733 | } |
| 734 | return func() { |
| 735 | u.duplicationSuppressor.Unlock(key) |
| 736 | }, nil |
| 737 | } |
| 738 | |
| 739 | func (u *Unpacker) makeChainIDKeyWithSnapshotter(chainID, snapshotter string) string { |
| 740 | return fmt.Sprintf("sn://%s/%v", snapshotter, chainID) |
no test coverage detected