Skip to content

Commit

Permalink
fix: handle calling req-id setting locally (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
chamini2 authored Feb 4, 2025
1 parent 9df38f8 commit a390060
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions projects/fal/src/fal/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,11 @@ async def set_global_object_preference(request, call_next):
@app.middleware("http")
async def set_request_id(request, call_next):
# NOTE: Setting request_id is not supported for websocket/realtime endpoints
if not os.getenv("IS_ISOLATE_AGENT") or not os.environ.get(
"NOMAD_ALLOC_PORT_grpc"
):
# If not running in the expected environment, skip setting request_id
return await call_next(request)

if self.isolate_channel is None:
grpc_port = os.environ.get("NOMAD_ALLOC_PORT_grpc")
Expand Down

0 comments on commit a390060

Please sign in to comment.