Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch active experiment id for given experiment label #417

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

riteshmodi
Copy link

No description provided.

@@ -333,16 +333,24 @@ protected Experiment internalGetExperiment(Application.Name appName,
Experiment experiment = null;

try {
ExperimentByAppNameLabel experimentAppLabel = experimentLabelIndexAccessor
.getExperimentBy(appName.toString(),
experimentLabel.toString()).one();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember correctly, then value fetched in this method are cached by wasabi. Did you notice one()? That means, it will fetch only 1 experiment label if there are 2.

com.intuit.wasabi.repository.cassandra.pojo.Experiment experimentPojo = experimentAccessor
.getExperimentById(experimentAppLabel.getId()).one();
experiment = ExperimentHelper.makeExperiment(experimentPojo);
if(experiment.getState().isActiveState()){
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will return only the experiment which is active

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant