feat: add durable WorldQuant backtests with UI and AI confirmation
This commit is contained in:
@@ -16,8 +16,11 @@ from .schemas import AlphaDetail, AlphaPage, BulkUpdate, JobInput, JobOutput, Re
|
||||
|
||||
|
||||
class Business:
|
||||
def __init__(self, db):
|
||||
def __init__(self, db, ai_context=None):
|
||||
from .backtests.service import Backtests
|
||||
|
||||
self.db = db
|
||||
self.backtests = Backtests(db, ai_context)
|
||||
|
||||
async def search_alphas(self, filters):
|
||||
query = list_statement(filters)
|
||||
@@ -196,6 +199,8 @@ class Business:
|
||||
|
||||
async def notify_job(runner, name, result):
|
||||
"""Notify the in-process runner only after the transaction has committed."""
|
||||
if name in ("start_backtest", "control_backtest"):
|
||||
runner.backtests.wake.set()
|
||||
if name == "cancel_job":
|
||||
await runner.cancel(result["job_id"])
|
||||
if name in ("create_sync_job", "retry_job"):
|
||||
|
||||
Reference in New Issue
Block a user