Skip to content

Commit

Permalink
fix memory graph (oras-project#115)
Browse files Browse the repository at this point in the history
Signed-off-by: Sylvia Lei <lixlei@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
  • Loading branch information
Wwwsylvia authored and qweeah committed Apr 6, 2022
1 parent 9c9a50a commit 57e2ce6
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions internal/graph/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (m *Memory) IndexAll(ctx context.Context, fetcher content.Fetcher, node oci
// prepare pre-handler
preHandler := HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
// skip the node if other go routine is working on it
done, committed := tracker.TryCommit(desc)
_, committed := tracker.TryCommit(desc)
if !committed {
return nil, ErrSkipDesc
}
Expand All @@ -66,8 +66,6 @@ func (m *Memory) IndexAll(ctx context.Context, fetcher content.Fetcher, node oci
key := descriptor.FromOCI(desc)
_, exists := m.indexed.Load(key)
if exists {
// mark the node as done
close(done)
return nil, ErrSkipDesc
}

Expand All @@ -80,8 +78,6 @@ func (m *Memory) IndexAll(ctx context.Context, fetcher content.Fetcher, node oci
return nil, err
}

// mark the node as done on success
close(done)
return downEdges, nil
})

Expand Down

0 comments on commit 57e2ce6

Please sign in to comment.