Add DB+.env auto backup with download and upload restore in Settings.
Backups land under /root/eth_hedge_backups; restore accepts zip body for new-server migration and restarts the process. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -59,6 +59,10 @@ async def lifespan(app: FastAPI):
|
||||
logger.exception("LIVE startup reconcile log failed")
|
||||
engine.ensure_loop()
|
||||
|
||||
from .backup import start_auto_backup_task
|
||||
|
||||
start_auto_backup_task()
|
||||
|
||||
session = bootstrap_session(settings)
|
||||
try:
|
||||
await session.start()
|
||||
@@ -79,6 +83,9 @@ async def lifespan(app: FastAPI):
|
||||
await engine._task
|
||||
except Exception:
|
||||
pass
|
||||
from .backup import stop_auto_backup_task
|
||||
|
||||
await stop_auto_backup_task()
|
||||
await session.stop()
|
||||
from .exchange import set_exchange
|
||||
from .strategy.session import set_session
|
||||
|
||||
Reference in New Issue
Block a user