MCPcopy Create free account
hub / github.com/Flagsmith/flagsmith / _sync_rollout_segment

Function _sync_rollout_segment

api/experimentation/services.py:566–578  ·  view source on GitHub ↗
(experiment: Experiment, rollout_percentage: float)

Source from the content-addressed store, hash-verified

564
565
566def _sync_rollout_segment(experiment: Experiment, rollout_percentage: float) -> Segment:
567 segment = experiment.rollout_segment
568 if segment is not None:
569 condition = Condition.objects.get(
570 rule__segment=segment, operator=PERCENTAGE_SPLIT
571 )
572 condition.value = str(rollout_percentage)
573 condition.save()
574 return segment
575 segment = _create_rollout_segment(experiment, rollout_percentage)
576 experiment.rollout_segment = segment
577 experiment.save()
578 return segment
579
580
581def _get_live_rollout_override(experiment: Experiment) -> FeatureState | None:

Callers 1

apply_experiment_rolloutFunction · 0.85

Calls 3

_create_rollout_segmentFunction · 0.85
getMethod · 0.45
saveMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…