From e74cdd4db305c46825c2cb0f9225e3bd8d1d68f9 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Sun, 1 Jan 2023 13:18:00 -0500 Subject: [PATCH] Fix limiter initialization --- libretranslate/app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libretranslate/app.py b/libretranslate/app.py index bd71404..cc48e4c 100644 --- a/libretranslate/app.py +++ b/libretranslate/app.py @@ -161,7 +161,6 @@ def create_app(args): from flask_limiter import Limiter limiter = Limiter( - bp, key_func=get_remote_address, default_limits=get_routes_limits( args.req_limit, args.daily_req_limit, api_keys_db @@ -996,6 +995,8 @@ def create_app(args): app.register_blueprint(bp, url_prefix=args.url_prefix) else: app.register_blueprint(bp) + + limiter.init_app(app) swag = swagger(app) swag["info"]["version"] = get_version()