Skip to content

[QUESTION] #244

@keyouth0

Description

@keyouth0

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions