refactor(); project refactor
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user