diff --git a/app.py b/app.py index 23b3291..7040067 100644 --- a/app.py +++ b/app.py @@ -23,7 +23,10 @@ limiter = Limiter( get_remote_address, app=app, default_limits=["50 per hour"], - storage_uri="memory://", + #storage_uri="memory://", # <- For development + storage_uri="redis://localhost:6379", + storage_options={"socket_connect_timeout": 30}, + strategy="fixed-window", # or "moving-window" ) assert os.path.isdir( diff --git a/requirements.txt b/requirements.txt index 99dc8c2..bd3c97f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,10 @@ +async-timeout==4.0.2 bcrypt==4.0.1 click==8.1.3 commonmark==0.9.1 Deprecated==1.2.13 Flask==2.2.2 -Flask-Limiter==3.1.0 +Flask-Limiter==3.3.0 gunicorn==20.1.0 importlib-metadata==6.0.0 itsdangerous==2.1.2 @@ -14,6 +15,7 @@ ordered-set==4.1.0 packaging==23.0 Pygments==2.14.0 PyYAML==6.0 +redis==4.5.4 rich==12.6.0 typing-extensions==4.4.0 Werkzeug==2.2.2