Closed tonybaloney closed 8 months ago
Equivalent demo with quart
from quart import Quart
app = Quart(__name__)
@app.route('/')
async def hello():
return 'hello'
@app.before_serving
async def create_db_pool():
print("running quart startup 1")
@app.before_serving
async def use_g():
print("Run quart startup 2")
@app.while_serving
async def lifespan():
print("Initial startup")
yield
print("Shutting down quart")
@app.after_serving
async def create_db_pool():
print("running quart shutdown 1")
Attention: 17 lines
in your changes are missing coverage. Please review.
Comparison is base (
b42035a
) 93.35% compared to head (f083cf8
) 92.97%.
Files | Patch % | Lines |
---|---|---|
azure/functions/_http_asgi.py | 83.87% | 3 Missing and 7 partials :warning: |
azure/functions/decorators/function_app.py | 41.66% | 6 Missing and 1 partial :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
If a startup event fails, it will capture the error in the logs, fail the request and retry on the next request. The exception is not reported to the HTTP result from the initiating request.
This PR calls the lifecycle event for startup and shutdown for an ASGI application provided by the new V2 wrapper.
This FastAPI application:
And this
function_app.py
code:Will run the startup and shutdown events for the Functions worker process.