mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 00:23:07 +00:00
feat: add paused state handler to rpc
This commit is contained in:
@@ -836,6 +836,21 @@ class RPC:
|
||||
self._freqtrade.state = State.RUNNING
|
||||
return {"status": "starting trader ..."}
|
||||
|
||||
def _rpc_pause(self) -> dict[str, str]:
|
||||
"""Handler for pause"""
|
||||
if self._freqtrade.state == State.PAUSED:
|
||||
return {"status": "already paused"}
|
||||
|
||||
if self._freqtrade.state == State.RUNNING:
|
||||
self._freqtrade.state = State.PAUSED
|
||||
return {"status": "pausing trader ..."}
|
||||
|
||||
if self._freqtrade.state == State.STOPPED:
|
||||
self._freqtrade.state = State.PAUSED
|
||||
return {"status": "starting bot with trader in paused state..."}
|
||||
|
||||
return {"status": "pausing trader ..."}
|
||||
|
||||
def _rpc_stop(self) -> dict[str, str]:
|
||||
"""Handler for stop"""
|
||||
if self._freqtrade.state == State.RUNNING:
|
||||
|
||||
Reference in New Issue
Block a user