Skip to content

Commit d6c5b55

Browse files
committed
updated sync tests
1 parent e60d86b commit d6c5b55

File tree

4 files changed

+616
-83
lines changed

4 files changed

+616
-83
lines changed

splitio/sync/split.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ def _fetch_until(self, fetch_options, till=None):
108108
_LOGGER.debug('Exception information: ', exc_info=True)
109109
raise exc
110110

111-
fetched_feature_flags = [splits.from_raw(feature_flag) for feature_flag in feature_flag_changes.get('splits', [])]
111+
fetched_feature_flags = []
112+
[fetched_feature_flags.append(splits.from_raw(feature_flag)) for feature_flag in feature_flag_changes.get('splits', [])]
112113
segment_list = update_feature_flag_storage(self._feature_flag_storage, fetched_feature_flags, feature_flag_changes['till'])
113114
if feature_flag_changes['till'] == feature_flag_changes['since']:
114115
return feature_flag_changes['till'], segment_list
@@ -225,9 +226,9 @@ async def _fetch_until(self, fetch_options, till=None):
225226
_LOGGER.debug('Exception information: ', exc_info=True)
226227
raise exc
227228

228-
fetched_feature_flags = [splits.from_raw(feature_flag) for feature_flag in feature_flag_changes.get('splits', [])]
229+
fetched_feature_flags = []
230+
[fetched_feature_flags.append(splits.from_raw(feature_flag)) for feature_flag in feature_flag_changes.get('splits', [])]
229231
segment_list = await update_feature_flag_storage_async(self._feature_flag_storage, fetched_feature_flags, feature_flag_changes['till'])
230-
await self._feature_flag_storage.set_change_number(feature_flag_changes['till'])
231232
if feature_flag_changes['till'] == feature_flag_changes['since']:
232233
return feature_flag_changes['till'], segment_list
233234

@@ -779,7 +780,7 @@ async def _synchronize_json(self):
779780
if await self._feature_flag_storage.get_change_number() > till and till != self._DEFAULT_FEATURE_FLAG_TILL:
780781
return []
781782
fetched_feature_flags = [splits.from_raw(feature_flag) for feature_flag in fetched]
782-
segment_list = await update_feature_flag_storage(self._feature_flag_storage, fetched_feature_flags, till)
783+
segment_list = await update_feature_flag_storage_async(self._feature_flag_storage, fetched_feature_flags, till)
783784
return segment_list
784785
except Exception as exc:
785786
_LOGGER.debug(exc)

0 commit comments

Comments
 (0)