Skip to content

Commit 896c954

Browse files
committed
cleanup
1 parent c3d721f commit 896c954

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

splitio/push/workers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def _run(self):
235235
_LOGGER.debug('Exception information: ', exc_info=True)
236236
pass
237237
sync_result = self._handler(event.change_number)
238-
if not sync_result.success and sync_result.error_code == 414:
238+
if not sync_result.success and sync_result.error_code is not None and sync_result.error_code == 414:
239239
_LOGGER.error("URI too long exception caught, sync failed")
240240

241241
if not sync_result.success:

splitio/sync/synchronizer.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ def sync_all(self, max_retry_attempts=_SYNC_ALL_NO_RETRIES):
425425
while True:
426426
try:
427427
sync_result = self.synchronize_splits(None, False)
428-
if not sync_result.success and sync_result.error_code == 414:
428+
if not sync_result.success and sync_result.error_code is not None and sync_result.error_code == 414:
429429
_LOGGER.error("URI too long exception caught, aborting retries")
430430
break
431431

@@ -587,7 +587,7 @@ async def sync_all(self, max_retry_attempts=_SYNC_ALL_NO_RETRIES):
587587
while True:
588588
try:
589589
sync_result = await self.synchronize_splits(None, False)
590-
if not sync_result.success and sync_result.error_code == 414:
590+
if not sync_result.success and sync_result.error_code is not None and sync_result.error_code == 414:
591591
_LOGGER.error("URI too long exception caught, aborting retries")
592592
break
593593

@@ -601,10 +601,6 @@ async def sync_all(self, max_retry_attempts=_SYNC_ALL_NO_RETRIES):
601601

602602
# All is good
603603
return
604-
except APIUriException as exc:
605-
_LOGGER.error("URI too long exception, aborting retries.")
606-
_LOGGER.debug('Error: ', exc_info=True)
607-
break
608604
except Exception as exc: # pylint:disable=broad-except
609605
_LOGGER.error("Exception caught when trying to sync all data: %s", str(exc))
610606
_LOGGER.debug('Error: ', exc_info=True)

0 commit comments

Comments
 (0)