Skip to content

Commit ddb9201

Browse files
committed
used private variable for manager retry attempts
1 parent 397581b commit ddb9201

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

splitio/sync/manager.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
class Manager(object): # pylint:disable=too-many-instance-attributes
1616
"""Manager Class."""
1717

18+
SYNC_ALL_ATTEMPTS = -1
1819
_CENTINEL_EVENT = object()
1920

2021
def __init__(self, ready_flag, synchronizer, auth_api, streaming_enabled, sdk_metadata, sse_url=None, client_key=None): # pylint:disable=too-many-arguments
@@ -58,15 +59,15 @@ def recreate(self):
5859
"""Recreate poolers for forked processes."""
5960
self._synchronizer._split_synchronizers._segment_sync.recreate()
6061

61-
def start(self, retry_attempts=-1):
62+
def start(self):
6263
"""
6364
Start the SDK synchronization tasks.
6465
6566
:param max_retry_attempts: apply max attempts if it set to absilute integer.
6667
:type max_retry_attempts: int
6768
"""
6869
try:
69-
self._synchronizer.sync_all(retry_attempts)
70+
self._synchronizer.sync_all(self.SYNC_ALL_ATTEMPTS)
7071
self._ready_flag.set()
7172
self._synchronizer.start_periodic_data_recording()
7273
if self._streaming_enabled:

tests/sync/test_manager.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ def run(x):
4545
synchronizer = Synchronizer(synchronizers, split_tasks)
4646
manager = Manager(threading.Event(), synchronizer, mocker.Mock(), False, SdkMetadata('1.0', 'some', '1.2.3.4'))
4747

48-
manager.start(1) # should not throw!
48+
manager.SYNC_ALL_ATTEMPTS = 1
49+
manager.start() # should not throw!
4950

5051
def test_start_streaming_false(self, mocker):
5152
splits_ready_event = threading.Event()

0 commit comments

Comments
 (0)