diff --git a/core/pkg/evaluator/json.go b/core/pkg/evaluator/json.go index f2a3b1028..e5044c1a3 100644 --- a/core/pkg/evaluator/json.go +++ b/core/pkg/evaluator/json.go @@ -331,18 +331,17 @@ func (je *Resolver) evaluateVariant(ctx context.Context, reqID string, flagKey s metadata[SelectorMetadataKey] = selector } - flagMetadata := je.store.MetadataForFlag(ctx, flag) - if flagMetadata.ID != "" { - metadata[ID] = flagMetadata.ID + if flag.Metadata.ID != "" { + metadata[ID] = flag.Metadata.ID } - if flagMetadata.Version != "" { - metadata[VERSION] = flagMetadata.Version + if flag.Metadata.Version != "" { + metadata[VERSION] = flag.Metadata.Version } - if flagMetadata.FlagSetID != "" { - metadata[FLAGSETID] = flagMetadata.FlagSetID + if flag.Metadata.FlagSetID != "" { + metadata[FLAGSETID] = flag.Metadata.FlagSetID } - if flagMetadata.FlagSetVersion != "" { - metadata[FLAGSETVERSION] = flagMetadata.FlagSetVersion + if flag.Metadata.FlagSetVersion != "" { + metadata[FLAGSETVERSION] = flag.Metadata.FlagSetVersion } if flag.State == Disabled { diff --git a/core/pkg/store/flags.go b/core/pkg/store/flags.go index 8e95c1c40..fd51c6d7f 100644 --- a/core/pkg/store/flags.go +++ b/core/pkg/store/flags.go @@ -15,7 +15,6 @@ type IStore interface { GetAll(ctx context.Context) (map[string]model.Flag, error) Get(ctx context.Context, key string) (model.Flag, bool) SelectorForFlag(ctx context.Context, flag model.Flag) string - MetadataForFlag(ctx context.Context, flag model.Flag) model.Metadata } type Flags struct { @@ -74,13 +73,6 @@ func (f *Flags) SelectorForFlag(_ context.Context, flag model.Flag) string { return f.SourceMetadata[flag.Source].Selector } -func (f *Flags) MetadataForFlag(_ context.Context, flag model.Flag) model.Metadata { - f.mx.RLock() - defer f.mx.RUnlock() - - return flag.Metadata -} - func (f *Flags) Delete(key string) { f.mx.Lock() defer f.mx.Unlock()