Remove return-value for _process
This commit is contained in:
parent
8c1efec43a
commit
8d813fa728
@ -744,8 +744,7 @@ def test_process_exchange_failures(default_conf, ticker, markets, mocker) -> Non
|
||||
worker = Worker(args=None, config=default_conf)
|
||||
patch_get_signal(worker.freqtrade)
|
||||
|
||||
result = worker._process()
|
||||
assert result is False
|
||||
worker._process()
|
||||
assert sleep_mock.has_calls()
|
||||
|
||||
|
||||
@ -763,8 +762,7 @@ def test_process_operational_exception(default_conf, ticker, markets, mocker) ->
|
||||
|
||||
assert worker.state == State.RUNNING
|
||||
|
||||
result = worker._process()
|
||||
assert result is False
|
||||
worker._process()
|
||||
assert worker.state == State.STOPPED
|
||||
assert 'OperationalException' in msg_mock.call_args_list[-1][0][0]['status']
|
||||
|
||||
@ -786,13 +784,14 @@ def test_process_trade_handling(
|
||||
|
||||
trades = Trade.query.filter(Trade.is_open.is_(True)).all()
|
||||
assert not trades
|
||||
result = freqtrade.process()
|
||||
assert result is True
|
||||
freqtrade.process()
|
||||
|
||||
trades = Trade.query.filter(Trade.is_open.is_(True)).all()
|
||||
assert len(trades) == 1
|
||||
|
||||
result = freqtrade.process()
|
||||
assert result is False
|
||||
# Nothing happened ...
|
||||
freqtrade.process()
|
||||
assert len(trades) == 1
|
||||
|
||||
|
||||
def test_process_trade_no_whitelist_pair(
|
||||
|
@ -127,11 +127,10 @@ class Worker(object):
|
||||
time.sleep(duration)
|
||||
return result
|
||||
|
||||
def _process(self) -> bool:
|
||||
def _process(self) -> None:
|
||||
logger.debug("========================================")
|
||||
state_changed = False
|
||||
try:
|
||||
state_changed = self.freqtrade.process()
|
||||
self.freqtrade.process()
|
||||
except TemporaryError as error:
|
||||
logger.warning(f"Error: {error}, retrying in {constants.RETRY_TIMEOUT} seconds...")
|
||||
time.sleep(constants.RETRY_TIMEOUT)
|
||||
@ -144,10 +143,6 @@ class Worker(object):
|
||||
})
|
||||
logger.exception('OperationalException. Stopping trader ...')
|
||||
self.freqtrade.state = State.STOPPED
|
||||
# TODO: The return value of _process() is not used apart tests
|
||||
# and should (could) be eliminated later. See PR #1689.
|
||||
# state_changed = True
|
||||
return state_changed
|
||||
|
||||
def _reconfigure(self) -> None:
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user