Is it possible to run code on only a specific worker in Uvicorn?
I have the following functions currently being executed on application startup.
@app.on_event('startup')
async def app_startup():
asyncio.create_task(check_idle())
asyncio.create_task(calculate_eta())
However, I'd only like a single worker (e.g. worker 0) to run those functions to avoid straining the database.
Is this possible? Thanks in advance.