feat: update worker to make paused state capable of bot startup and running process

This commit is contained in:
Axel-CH
2025-03-23 15:12:42 -04:00
parent b6b3429b62
commit df4b44d09e

View File

@@ -96,7 +96,7 @@ class Worker:
logger.info(
f"Changing state{f' from {old_state.name}' if old_state else ''} to: {state.name}"
)
if state == State.RUNNING:
if state == State.RUNNING or state == State.PAUSED:
self.freqtrade.startup()
if state == State.STOPPED:
@@ -112,9 +112,10 @@ class Worker:
self._throttle(func=self._process_stopped, throttle_secs=self._throttle_secs)
elif state == State.RUNNING:
elif state == State.RUNNING or state == State.PAUSED:
state_str = "RUNNING" if state == State.RUNNING else "PAUSED"
# Ping systemd watchdog before throttling
self._notify("WATCHDOG=1\nSTATUS=State: RUNNING.")
self._notify(f"WATCHDOG=1\nSTATUS=State: {state_str}.")
# Use an offset of 1s to ensure a new candle has been issued
self._throttle(