Skip to content

Commit

Permalink
move store.init() into store.SetBasis
Browse files Browse the repository at this point in the history
  • Loading branch information
cwaldren-ld committed Sep 26, 2024
1 parent 024c0df commit 6ac4d74
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions internal/datasystem/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,10 @@ func (s *Store) Close() error {
// set persist to true.
func (s *Store) SetBasis(events []fdv2proto.Event, selector *fdv2proto.Selector, persist bool) error {
collections := fdv2proto.ToStorableItems(events)
return s.init(collections, selector, persist)
}

func (s *Store) init(allData []ldstoretypes.Collection, selector *fdv2proto.Selector, persist bool) error {
s.mu.Lock()
defer s.mu.Unlock()

s.memoryStore.SetBasis(allData)
s.memoryStore.SetBasis(collections)

s.persist = persist
s.selector = selector
Expand All @@ -169,10 +165,9 @@ func (s *Store) init(allData []ldstoretypes.Collection, selector *fdv2proto.Sele
if s.shouldPersist() {
//nolint:godox
// TODO(SDK-711): We need to sort the data in dependency order before inserting it.
return s.persistentStore.impl.Init(allData)
return s.persistentStore.impl.Init(collections)
}

return nil
}

Check failure on line 171 in internal/datasystem/store.go

View workflow job for this annotation

GitHub Actions / Windows, Go 1.23

missing return

Check failure on line 171 in internal/datasystem/store.go

View workflow job for this annotation

GitHub Actions / Windows, Go 1.22

missing return

Check failure on line 171 in internal/datasystem/store.go

View workflow job for this annotation

GitHub Actions / Windows, Go 1.18

missing return

Check failure on line 171 in internal/datasystem/store.go

View workflow job for this annotation

GitHub Actions / Linux, Go 1.18 / Unit Tests and Coverage

missing return (typecheck)

Check failure on line 171 in internal/datasystem/store.go

View workflow job for this annotation

GitHub Actions / Linux, Go 1.18 / Benchmarks

missing return

Check failure on line 171 in internal/datasystem/store.go

View workflow job for this annotation

GitHub Actions / ldotel Linux, Go 1.23

missing return (typecheck)

Check failure on line 171 in internal/datasystem/store.go

View workflow job for this annotation

GitHub Actions / ldotel Linux, Go 1.23

missing return) (typecheck)

Check failure on line 171 in internal/datasystem/store.go

View workflow job for this annotation

GitHub Actions / Linux, Go 1.22 / Benchmarks

missing return

Check failure on line 171 in internal/datasystem/store.go

View workflow job for this annotation

GitHub Actions / ldotel Linux, Go 1.22

missing return (typecheck)

Check failure on line 171 in internal/datasystem/store.go

View workflow job for this annotation

GitHub Actions / ldotel Linux, Go 1.22

missing return) (typecheck)

Check failure on line 171 in internal/datasystem/store.go

View workflow job for this annotation

GitHub Actions / ldotel Linux, Go 1.18

missing return (typecheck)

Check failure on line 171 in internal/datasystem/store.go

View workflow job for this annotation

GitHub Actions / Linux, Go 1.22 / Unit Tests and Coverage

missing return (typecheck)

Check failure on line 171 in internal/datasystem/store.go

View workflow job for this annotation

GitHub Actions / Linux, Go 1.22 / Unit Tests and Coverage

missing return) (typecheck)

Check failure on line 171 in internal/datasystem/store.go

View workflow job for this annotation

GitHub Actions / Linux, Go 1.23 / Benchmarks

missing return

Check failure on line 171 in internal/datasystem/store.go

View workflow job for this annotation

GitHub Actions / Linux, Go 1.23 / Unit Tests and Coverage

missing return (typecheck)

Check failure on line 171 in internal/datasystem/store.go

View workflow job for this annotation

GitHub Actions / Linux, Go 1.23 / Unit Tests and Coverage

missing return) (typecheck)

func (s *Store) shouldPersist() bool {
Expand Down

0 comments on commit 6ac4d74

Please sign in to comment.