pre-commit-ci-lite[bot]
4 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
3 additions and
3 deletions
-
fastapi/routing.py
|
|
|
@ -237,9 +237,9 @@ class _DefaultLifespan: |
|
|
|
# Uses WeakKeyDictionary so entries are automatically evicted when the endpoint |
|
|
|
# function is garbage collected (e.g., when a dynamically created FastAPI app is |
|
|
|
# destroyed), preventing both memory leaks and stale-ID lookups. |
|
|
|
_endpoint_context_cache: weakref.WeakKeyDictionary[Callable[..., Any], EndpointContext] = ( |
|
|
|
weakref.WeakKeyDictionary() |
|
|
|
) |
|
|
|
_endpoint_context_cache: weakref.WeakKeyDictionary[ |
|
|
|
Callable[..., Any], EndpointContext |
|
|
|
] = weakref.WeakKeyDictionary() |
|
|
|
|
|
|
|
|
|
|
|
def _extract_endpoint_context(func: Any) -> EndpointContext: |
|
|
|
|