Skip to content

Commit

Permalink
differentiate apps with no hints
Browse files Browse the repository at this point in the history
  • Loading branch information
isidentical committed Jan 27, 2024
1 parent ff449dd commit 03b9503
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion projects/fal/src/fal/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def setup(self):

def provide_hints(self) -> list[str]:
"""Provide hints for routing the application."""
return []
raise NotImplementedError

def serve(self) -> None:
import uvicorn
Expand All @@ -102,6 +102,10 @@ async def provide_hints(request, call_next):
response = await call_next(request)
try:
response.headers["X-Fal-Runner-Hints"] = ",".join(self.provide_hints())
except NotImplementedError:
# This lets us differentiate between apps that don't provide hints
# and apps that provide empty hints.
pass
except Exception as exc:
from fastapi.logger import logger

Expand Down

0 comments on commit 03b9503

Please sign in to comment.