Commit 3f885b3
committed
Fix route discovery on starlette < 0.20.1
starlette._utils.is_async_callable was introduced in 0.20.1. On older
versions (e.g. 0.16.0 used by FastAPI 0.70.0) the ImportError caused
an early return, skipping the post_response handler entirely. This
meant routes were never recorded in heartbeats.
Fall back to inspect.iscoroutinefunction when _utils is unavailable.1 parent 007719c commit 3f885b3
1 file changed
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | 48 | | |
50 | | - | |
| 49 | + | |
51 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
52 | 58 | | |
53 | 59 | | |
54 | 60 | | |
| |||
0 commit comments