Skip to content

Commit 5f8e096

Browse files
feat: Add retry handling to DataFrameClient (#116)
Co-authored-by: Richard Bell <[email protected]>
1 parent cdff43c commit 5f8e096

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

nisystemlink/clients/dataframe/_data_frame_client.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,17 @@
1313
)
1414
from nisystemlink.clients.core.helpers import IteratorFileLike
1515
from requests.models import Response
16-
from uplink import Body, Field, Path, Query
16+
from uplink import Body, Field, Path, Query, retry
1717

1818
from . import models
1919

2020

21+
# retry for common http status codes and any Connection error
22+
@retry(
23+
when=retry.when.status([429, 502, 503, 504]),
24+
stop=retry.stop.after_attempt(5),
25+
on_exception=retry.CONNECTION_ERROR,
26+
)
2127
class DataFrameClient(BaseClient):
2228
def __init__(self, configuration: Optional[core.HttpConfiguration] = None):
2329
"""Initialize an instance.

0 commit comments

Comments
 (0)