Пример #1
0
        public bool IsExperimentEnabled(ExperimentationConstants experimentation)
        {
            var isEnvVarEnabled = !string.IsNullOrEmpty(experimentation.FlightEnvironmentVariable) &&
                                  _environmentVariableReader.GetEnvironmentVariable(experimentation.FlightEnvironmentVariable) == "1";

            return(isEnvVarEnabled || _experimentationService.IsCachedFlightEnabled(experimentation.FlightFlag));
        }
Пример #2
0
        public bool IsExperimentEnabled(ExperimentationConstants experiment)
        {
            var isExpForcedEnabled  = false;
            var isExpForcedDisabled = false;

            if (!string.IsNullOrEmpty(experiment.FlightEnvironmentVariable))
            {
                string envVarOverride = _environmentVariableReader.GetEnvironmentVariable(experiment.FlightEnvironmentVariable);

                isExpForcedDisabled = envVarOverride == "0";
                isExpForcedEnabled  = envVarOverride == "1";
            }

            return(!isExpForcedDisabled && (isExpForcedEnabled || _experimentationService.IsCachedFlightEnabled(experiment.FlightFlag)));
        }