This commit is contained in:
yumoqing 2026-02-13 15:46:17 +08:00
parent 975f14ed30
commit de796b7d7e
2 changed files with 9 additions and 3 deletions

View File

@ -108,7 +108,6 @@ class FlowEngine:
env = ServerEnv()
self.aio = []
async with (env, 'workflow') as sor:
fid = env.uuid()
self.aio = await sor.R('flow_instance', {'status': 'running'})
while True:
for r in self.aio:

View File

@ -1,10 +1,17 @@
from functools import partial
from ahserver.serverenv import ServerEnv
from ahserver.configuredServer import add_startup
from ahserver.configuredServer import add_cleanupctx
from .dagflow import FlowEngine
async def dagbacktask(engine, app):
task = asyncio.create_task(engine.bgtask())
yield
task.cancel()
def load_dagflow():
engine = FlowEngine()
add_startup(engine.bgtask)
f = partial(dagbacktask, engine)
add_cleanupctx(f)
env = ServerEnv()
env.workflow_engine = engine