Skip to content

Commit 6fecaf3

Browse files
authored
Modified the retry logic for handling Internal Server Errors (#84)
1 parent 2fbe099 commit 6fecaf3

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

fyle/platform/internals/api_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def _format_api_url(self, endpoint):
2626
endpoint=endpoint
2727
)
2828

29-
@retry(n=3, backoff=5, exceptions=exceptions.InvalidTokenError)
29+
@retry(n=3, backoff=5, exceptions=(exceptions.InvalidTokenError, exceptions.InternalServerError))
3030
def make_get_request(self, api_url, query_params=None):
3131
"""Create a HTTP GET request.
3232
Parameters:

fyle/platform/internals/decorators.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
import time
66

7+
from functools import wraps
8+
79
from .auth import Auth
810
from .. import exceptions as exc
911

@@ -19,6 +21,7 @@ def retry(n, backoff, exceptions):
1921
"""
2022

2123
def decorator(func):
24+
@wraps(func)
2225
def new_fn(*args, **kwargs):
2326
attempt = 0
2427
while attempt < n:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name='fyle',
8-
version='v0.36.0',
8+
version='v0.36.1',
99
author='Siva Narayanan',
1010
author_email='[email protected]',
1111
description='Python SDK for accessing Fyle Platform APIs',

0 commit comments

Comments
 (0)