Skip to content

Commit

Permalink
chore: Consider ldd-mode data as refreshed
Browse files Browse the repository at this point in the history
  • Loading branch information
keelerm84 committed Dec 23, 2024
1 parent 9aa1e65 commit fd68d42
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/datasystem/fdv2_datasystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,11 @@ func (f *FDv2) DataAvailability() DataAvailability {
if f.store.Selector().IsDefined() {
return Refreshed
}

if !f.hasDataSources() && f.store.hasReadOnlyPersistence() {
return Refreshed
}

if f.store.IsInitialized() {
return Cached
}
Expand Down
8 changes: 8 additions & 0 deletions internal/datasystem/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,14 @@ func (s *Store) getActive() subsystems.ReadOnlyStore {
return s.active
}

func (s *Store) hasReadOnlyPersistence() bool {
if s.persistentStore == nil {
return false
}

return s.persistentStore.mode == subsystems.DataStoreModeRead
}

//nolint:revive // Implementation for ReadOnlyStore.
func (s *Store) GetAll(kind ldstoretypes.DataKind) ([]ldstoretypes.KeyedItemDescriptor, error) {
return s.getActive().GetAll(kind)
Expand Down
1 change: 1 addition & 0 deletions ldcomponents/data_system_configuration_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ func (d *DataSystemConfigurationBuilder) Build(
}
conf.Store = store
}
conf.StoreMode = d.storeMode
for i, initializerBuilder := range d.initializerBuilders {
if initializerBuilder == nil {
return ss.DataSystemConfiguration{},
Expand Down

0 comments on commit fd68d42

Please sign in to comment.