Skip to content

Commit

Permalink
else
Browse files Browse the repository at this point in the history
  • Loading branch information
chamini2 committed Nov 12, 2024
1 parent 532b5dc commit ec2d1f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions projects/fal/src/fal/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,10 @@ async def _unset_at_end():

try:
response: fastapi.responses.Response = await call_next(request)

except BaseException:
await _unset_at_end()
raise
else:
# We need to wait for the entire response to be sent before
# we can set the logger labels back to the default.
background_tasks = fastapi.BackgroundTasks()
Expand All @@ -394,9 +397,6 @@ async def _unset_at_end():
response.background = background_tasks

return response
except BaseException:
await _unset_at_end()
raise

@app.exception_handler(RequestCancelledException)
async def value_error_exception_handler(
Expand Down

0 comments on commit ec2d1f6

Please sign in to comment.