Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion examples/fastapi-background-tasks/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
@app.middleware("http")
async def send_done_message(request, call_next):
response = await call_next(request)
background_task.done()
# only Lambda invokes carry this header; skip readiness checks
if "x-amzn-lambda-context" in request.headers:
background_task.done()
return response

def mock_task(seconds):
Expand Down
Loading