Description
I need to asynchronously get some config from my config server using repeated task.
I declare a function to asynchronously get config decorated with the @app.on_event("startup") and @repeat_every.
like this:
@app.on_event("startup")
@repeat_every(seconds=60)
async def listener_task() -> None:
And I use the config in another function decorated with the @app.on_event("startup").
like this:
@app.on_event("startup")
async def init_orm() -> None:
How can I ensure the first time I get the config before using the config.
Additional context
Add any other context or screenshots about the feature request here.
Description I need to asynchronously get some config from my config server using repeated task.
I declare a function to asynchronously get config decorated with the @app.on_event("startup") and @repeat_every. like this: @app.on_event("startup") @repeat_every(seconds=60) async def listener_task() -> None:
And I use the config in another function decorated with the @app.on_event("startup"). like this: @app.on_event("startup") async def init_orm() -> None:
How can I ensure the first time I get the config before using the config.
Additional context Add any other context or screenshots about the feature request here.