diff --git a/llmage/asyncinference.py b/llmage/asyncinference.py index 6d05a1d..e7e705d 100644 --- a/llmage/asyncinference.py +++ b/llmage/asyncinference.py @@ -36,6 +36,10 @@ async def get_asynctask_status(request, taskid): if recs: r = recs[0] output = await get_lastoutput(r.ioinfo) + t = timestampAdd(r.use_time, 600) + now = time.time() + if r.status not in ['FAILED', 'SUCCEEDED'] and now > t: + asyncio.create_task(query_task_status(request, r.id)) return output return { 'taskid': taskid,