Skip to content

Commit

Permalink
WIP - Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSisley committed Nov 19, 2024
1 parent 27893cf commit 91e188c
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions internal/db/fetcher/versioned.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,33 +153,18 @@ func (vf *VersionedFetcher) Init(

// Start serializes the correct state according to the Key and CID.
func (vf *VersionedFetcher) Start(ctx context.Context, spans ...core.Span) error {
if vf.col == nil {
return client.NewErrUninitializeProperty("VersionedFetcher", "CollectionDescription")
}

if len(spans) != 1 {
return ErrSingleSpanOnly
}

// VersionedFetcher only ever recieves a headstore key
//nolint:forcetypeassert
prefix := spans[0].Start.(keys.HeadstoreDocKey)
dk := prefix.DocID
cid := prefix.Cid
if dk == "" {
return client.NewErrUninitializeProperty("Spans", "DocID")
} else if !cid.Defined() {
return client.NewErrUninitializeProperty("Spans", "CID")
}

vf.ctx = ctx
vf.dsKey = keys.DataStoreKey{
CollectionRootID: vf.col.Description().RootID,
DocID: dk,
DocID: prefix.DocID,
}

if err := vf.seekTo(cid); err != nil {
return NewErrFailedToSeek(cid, err)
if err := vf.seekTo(prefix.Cid); err != nil {
return NewErrFailedToSeek(prefix.Cid, err)
}

return vf.DocumentFetcher.Start(ctx)
Expand Down

0 comments on commit 91e188c

Please sign in to comment.