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

new FastAPI lifespan might not work in lambda #102

Closed
vincentsarago opened this issue Jun 22, 2023 · 1 comment · Fixed by #103
Closed

new FastAPI lifespan might not work in lambda #102

vincentsarago opened this issue Jun 22, 2023 · 1 comment · Fixed by #103

Comments

@vincentsarago
Copy link
Member

if "AWS_EXECUTION_ENV" in os.environ:
loop = asyncio.get_event_loop()
loop.run_until_complete(app.router.startup())

previously we were checking if we were in AWS Lambda to run the startup event but with the new lifespan method implemented in latest FastAPI (and used in tipg https://github.com/developmentseed/tipg/blob/main/tipg/main.py#L32-L59) we might have the same issue

ref:

@vincentsarago
Copy link
Member Author

I confirmed this. There is no more app.router.startup for the tipg application 🤦

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

Successfully merging a pull request may close this issue.

1 participant