Skip to content

Commit dd04c32

Browse files
committed
Adding TA to uwsgi Split constructor
1 parent ae984c7 commit dd04c32

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

splitio/uwsgi.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,9 @@ def _parse_split(self, split, block_until_ready=False):
377377
split['name'], split['seed'], split['killed'],
378378
split['defaultTreatment'], split['trafficTypeName'],
379379
split['status'], split['changeNumber'],
380-
segment_cache=self._segment_cache, algo=split.get('algo')
380+
segment_cache=self._segment_cache, algo=split.get('algo'),
381+
traffic_allocation=split.get('trafficAllocation'),
382+
traffic_allocation_seed=split.get('trafficAllocationSeed')
381383
)
382384

383385
def _parse_matcher_in_segment(self, partial_split, matcher, block_until_ready=False, *args,
@@ -389,7 +391,9 @@ def _parse_matcher_in_segment(self, partial_split, matcher, block_until_ready=Fa
389391
return delegate
390392

391393
class UWSGISplit(Split):
392-
def __init__(self, name, seed, killed, default_treatment, traffic_type_name, status, change_number, conditions=None, segment_cache=None, algo=None):
394+
def __init__(self, name, seed, killed, default_treatment, traffic_type_name, status, change_number, conditions=None, segment_cache=None, algo=None,
395+
traffic_allocation=None,
396+
traffic_allocation_seed=None):
393397
"""A split implementation that mantains a reference to the segment cache so segments can
394398
be easily pickled and unpickled.
395399
:param name: Name of the feature
@@ -407,7 +411,8 @@ def __init__(self, name, seed, killed, default_treatment, traffic_type_name, sta
407411
"""
408412
super(UWSGISplit, self).__init__(
409413
name, seed, killed, default_treatment, traffic_type_name, status,
410-
change_number, conditions, algo)
414+
change_number, conditions, algo, traffic_allocation,
415+
traffic_allocation_seed)
411416
self._segment_cache = segment_cache
412417

413418
@property

0 commit comments

Comments
 (0)