Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events not working if put before VersionedFastAPI initialization #63

Open
arhen opened this issue Dec 2, 2021 · 2 comments
Open

Events not working if put before VersionedFastAPI initialization #63

arhen opened this issue Dec 2, 2021 · 2 comments

Comments

@arhen
Copy link

arhen commented Dec 2, 2021

Actual behavior
I have events on startup and shutdown. When I put these configs before VersionedFastAPI initialization, the events does not working.

# App Event Setting
@app.on_event("startup")
async def startup():
    await database.connect()

@app.on_event("shutdown")
async def shutdown():
    await database.disconnect()

# versioning
app = VersionedFastAPI(app,
    version_format='{major}',
    prefix_format='/v{major}',
    enable_latest=True)

Expected behavior
I hope it still working even all Events setting put before VersionedFastAPI initialization.

@shailendrafaarms
Copy link

We are also facing this issue. And it is very trivial.

@mbengchan
Copy link

I am still facing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants