refactor(); project refactor

This commit is contained in:
ITQ
2026-02-23 11:46:52 +03:00
parent 85923f11fc
commit ca0c456862
16 changed files with 198 additions and 194 deletions
+2 -3
View File
@@ -8,6 +8,7 @@ from django.core.cache import cache
from django.utils import timezone
from prometheus_client import Counter
from apps.conflicts.models import ExperimentConflictDomain
from apps.conflicts.services import resolve_domain_conflict
from apps.events.models import Decision
from apps.events.services import decision_create
@@ -145,8 +146,6 @@ def _check_participation_limits(
def _check_domain_conflicts(experiment: Experiment) -> bool:
from apps.conflicts.models import ExperimentConflictDomain
memberships = ExperimentConflictDomain.objects.filter(
experiment=experiment,
).select_related("conflict_domain")
@@ -271,7 +270,7 @@ def decide_for_flag(
"variant",
)
total_weight = sum(v.weight for v in variants)
normalized_hash = variant_hash * total_weight / Decimal("100")
normalized_hash = variant_hash * total_weight / Decimal(100)
selected = _select_variant(variants, normalized_hash)
DECIDE_REQUESTS.labels(reason="experiment_assigned").inc()