Skip to content

Commit 8df0a47

Browse files
committed
Addressing Mike's feedback
1 parent 7f09841 commit 8df0a47

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

optimizely/decision/composite_feature_service.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ var cfLogger = logging.GetLogger("CompositeFeatureService")
2828

2929
// CompositeFeatureService is the default out-of-the-box feature decision service
3030
type CompositeFeatureService struct {
31-
featureExperimentDecisionService ExperimentService
32-
rolloutDecisionService FeatureService
31+
featureExperimentService ExperimentService
32+
rolloutDecisionService FeatureService
3333
}
3434

3535
// NewCompositeFeatureService returns a new instance of the CompositeFeatureService
3636
func NewCompositeFeatureService() *CompositeFeatureService {
3737
return &CompositeFeatureService{
38-
featureExperimentDecisionService: NewFeatureExperimentService(),
39-
rolloutDecisionService: NewRolloutService(),
38+
featureExperimentService: NewFeatureExperimentService(),
39+
rolloutDecisionService: NewRolloutService(),
4040
}
4141
}
4242

@@ -45,15 +45,15 @@ func (f CompositeFeatureService) GetDecision(decisionContext FeatureDecisionCont
4545
feature := decisionContext.Feature
4646

4747
// Check if user is bucketed in feature experiment
48-
if f.featureExperimentDecisionService != nil && len(feature.FeatureExperiments) > 0 {
48+
if f.featureExperimentService != nil && len(feature.FeatureExperiments) > 0 {
4949
// @TODO: add in a feature decision service that takes into account multiple experiments (via group mutex)
5050
experiment := feature.FeatureExperiments[0]
5151
experimentDecisionContext := ExperimentDecisionContext{
5252
Experiment: &experiment,
5353
ProjectConfig: decisionContext.ProjectConfig,
5454
}
5555

56-
experimentDecision, err := f.featureExperimentDecisionService.GetDecision(experimentDecisionContext, userContext)
56+
experimentDecision, err := f.featureExperimentService.GetDecision(experimentDecisionContext, userContext)
5757
// Variation not nil means we got a decision and should return it
5858
if experimentDecision.Variation != nil {
5959
featureDecision := FeatureDecision{

optimizely/decision/feature_experiment_service.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323

2424
// FeatureExperimentService helps evaluate feature test associated with the feature
2525
type FeatureExperimentService struct {
26-
featureExperimentDecisionService ExperimentService
26+
featureExperimentService ExperimentService
2727
}
2828

2929
// NewFeatureExperimentService returns a new instance of the FeatureExperimentService
@@ -33,5 +33,5 @@ func NewFeatureExperimentService() *CompositeExperimentService {
3333

3434
// GetDecision returns a decision for the given feature test and user context
3535
func (f FeatureExperimentService) GetDecision(decisionContext ExperimentDecisionContext, userContext entities.UserContext) (ExperimentDecision, error) {
36-
return f.featureExperimentDecisionService.GetDecision(decisionContext, userContext)
36+
return f.featureExperimentService.GetDecision(decisionContext, userContext)
3737
}

0 commit comments

Comments
 (0)