Skip to content

Commit 6ba74cc

Browse files
committed
fix: add slowapi_startup method for Starlette startup event
1 parent 5e2b9c1 commit 6ba74cc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

slowapi/extension.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from starlette.datastructures import MutableHeaders
3333
from starlette.requests import Request
3434
from starlette.responses import JSONResponse, Response
35+
from starlette.applications import Starlette
3536
from typing_extensions import Literal
3637

3738
from .errors import RateLimitExceeded
@@ -326,7 +327,7 @@ def emit(*_):
326327
self._fallback_storage = MemoryStorage()
327328
self._fallback_limiter = STRATEGIES[strategy](self._fallback_storage)
328329

329-
def slowapi_startup(self) -> None:
330+
def slowapi_startup(self, app: Starlette) -> None:
330331
"""
331332
Starlette startup event handler that links the app with the Limiter instance.
332333
"""

0 commit comments

Comments
 (0)