Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Added on March 3, 2025 12:15PM
Likes: 0
Replies: 0
Hello, i'm trying to run a background task when my endpoint is call.
Here is a simple example of what i am trying to do.
import asyncio async def run_task_background(parameters):
job_uid = await run_task(parameters)
#add job_uid in a table def api_py_function(): asyncio.run(run_task_background(parameters))
return {"status": "Creating task"}
I tried a lot of different formulation but i always receive an error :
Failed to run function : <class 'TypeError'> : Object of type coroutine is not JSON serializable
Does somebody know what i am doing wrong ?
Thank you