Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry on server unavailable #1085

Merged
merged 10 commits into from
Nov 14, 2023
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ click==8.1.7
funcparserlib==1.0.1
graphviz==0.20.1
humanize==4.8.0
neuro-cli==23.10.0
neuro-cli==23.11.0
neuro-extras==23.11.0
pyyaml==6.0.1
rich==13.6.0
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ zip_safe=False
python_requires = >=3.8.0
include_package_data = True
install_requires =
neuro-cli>=23.7.0
neuro-cli>=23.11.0
pyyaml>=5.4
funcparserlib>=1.0.0
humanize>=0.5.1
2 changes: 1 addition & 1 deletion src/neuro_flow/expr.py
Original file line number Diff line number Diff line change
@@ -909,7 +909,7 @@ def make_dict(
) -> DictMaker:
lst = [(args[0], args[1])]
if len(args) > 2:
lst += args[2] # type: ignore
lst += args[2]
return DictMaker(lst[0][0].start, lst[-1][1].end, lst)


4 changes: 2 additions & 2 deletions src/neuro_flow/utils.py
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
import logging
import time
from functools import wraps
from neuro_sdk import ClientError, JobStatus, ServerNotAvailable
from neuro_sdk import BadGateway, ClientError, JobStatus, ServerNotAvailable
from typing import (
Any,
Awaitable,
@@ -251,7 +251,7 @@ async def inner(self: _SELF, *args: _P.args, **kwargs: _P.kwargs) -> _R:
delay=self._delay,
factor=self._delay_factor,
cap=self._delay_cap,
exceptions=(ClientError, ServerNotAvailable, OSError),
exceptions=(ClientError, ServerNotAvailable, BadGateway, OSError),
):
async with retry:
return await func(self, *args, **kwargs)