Skip to content

Commit 4714ec1

Browse files
feat: Update TestMonitorClient, ProductClient, and SpecsClient with retry handling (#124)
1 parent 9d0d923 commit 4714ec1

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

nisystemlink/clients/product/_product_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212

1313
@retry(
14-
when=retry.when.status([408, 429, 502, 503, 504]), stop=retry.stop.after_attempt(5)
14+
when=retry.when.status([408, 429, 502, 503, 504]),
15+
stop=retry.stop.after_attempt(5),
16+
on_exception=retry.CONNECTION_ERROR,
1517
)
1618
class ProductClient(BaseClient):
1719
def __init__(self, configuration: Optional[core.HttpConfiguration] = None):

nisystemlink/clients/spec/_spec_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212

1313
@retry(
14-
when=retry.when.status([408, 429, 502, 503, 504]), stop=retry.stop.after_attempt(5)
14+
when=retry.when.status([408, 429, 502, 503, 504]),
15+
stop=retry.stop.after_attempt(5),
16+
on_exception=retry.CONNECTION_ERROR,
1517
)
1618
class SpecClient(BaseClient):
1719
def __init__(self, configuration: Optional[core.HttpConfiguration] = None):

nisystemlink/clients/testmonitor/_test_monitor_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515

1616

1717
@retry(
18-
when=retry.when.status([408, 429, 502, 503, 504]), stop=retry.stop.after_attempt(5)
18+
when=retry.when.status([408, 429, 502, 503, 504]),
19+
stop=retry.stop.after_attempt(5),
20+
on_exception=retry.CONNECTION_ERROR,
1921
)
2022
class TestMonitorClient(BaseClient):
2123
# prevent pytest from thinking this is a test class

0 commit comments

Comments
 (0)