Add more backoff to fetch_order endpoint
This commit is contained in:
parent
6c77feee85
commit
3915101d2d
@ -1008,7 +1008,7 @@ class Exchange:
|
|||||||
|
|
||||||
return order
|
return order
|
||||||
|
|
||||||
@retrier
|
@retrier(retries=5)
|
||||||
def fetch_order(self, order_id: str, pair: str) -> Dict:
|
def fetch_order(self, order_id: str, pair: str) -> Dict:
|
||||||
if self._config['dry_run']:
|
if self._config['dry_run']:
|
||||||
try:
|
try:
|
||||||
|
@ -78,7 +78,7 @@ class Ftx(Exchange):
|
|||||||
except ccxt.BaseError as e:
|
except ccxt.BaseError as e:
|
||||||
raise OperationalException(e) from e
|
raise OperationalException(e) from e
|
||||||
|
|
||||||
@retrier
|
@retrier(retries=5)
|
||||||
def fetch_stoploss_order(self, order_id: str, pair: str) -> Dict:
|
def fetch_stoploss_order(self, order_id: str, pair: str) -> Dict:
|
||||||
if self._config['dry_run']:
|
if self._config['dry_run']:
|
||||||
try:
|
try:
|
||||||
|
@ -1896,10 +1896,10 @@ def test_fetch_order(default_conf, mocker, exchange_name):
|
|||||||
assert tm.call_args_list[1][0][0] == 2
|
assert tm.call_args_list[1][0][0] == 2
|
||||||
assert tm.call_args_list[2][0][0] == 5
|
assert tm.call_args_list[2][0][0] == 5
|
||||||
assert tm.call_args_list[3][0][0] == 10
|
assert tm.call_args_list[3][0][0] == 10
|
||||||
assert api_mock.fetch_order.call_count == API_RETRY_COUNT + 1
|
assert api_mock.fetch_order.call_count == 6
|
||||||
|
|
||||||
ccxt_exceptionhandlers(mocker, default_conf, api_mock, exchange_name,
|
ccxt_exceptionhandlers(mocker, default_conf, api_mock, exchange_name,
|
||||||
'fetch_order', 'fetch_order',
|
'fetch_order', 'fetch_order', retries=6,
|
||||||
order_id='_', pair='TKN/BTC')
|
order_id='_', pair='TKN/BTC')
|
||||||
|
|
||||||
|
|
||||||
@ -1932,6 +1932,7 @@ def test_fetch_stoploss_order(default_conf, mocker, exchange_name):
|
|||||||
|
|
||||||
ccxt_exceptionhandlers(mocker, default_conf, api_mock, exchange_name,
|
ccxt_exceptionhandlers(mocker, default_conf, api_mock, exchange_name,
|
||||||
'fetch_stoploss_order', 'fetch_order',
|
'fetch_stoploss_order', 'fetch_order',
|
||||||
|
retries=6,
|
||||||
order_id='_', pair='TKN/BTC')
|
order_id='_', pair='TKN/BTC')
|
||||||
|
|
||||||
|
|
||||||
|
@ -154,4 +154,5 @@ def test_fetch_stoploss_order(default_conf, mocker):
|
|||||||
|
|
||||||
ccxt_exceptionhandlers(mocker, default_conf, api_mock, 'ftx',
|
ccxt_exceptionhandlers(mocker, default_conf, api_mock, 'ftx',
|
||||||
'fetch_stoploss_order', 'fetch_orders',
|
'fetch_stoploss_order', 'fetch_orders',
|
||||||
|
retries=6,
|
||||||
order_id='_', pair='TKN/BTC')
|
order_id='_', pair='TKN/BTC')
|
||||||
|
Loading…
Reference in New Issue
Block a user