mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2024-12-18 08:27:03 +02:00
Fix limiter initialization
This commit is contained in:
parent
67453b0c15
commit
e74cdd4db3
@ -161,7 +161,6 @@ def create_app(args):
|
|||||||
from flask_limiter import Limiter
|
from flask_limiter import Limiter
|
||||||
|
|
||||||
limiter = Limiter(
|
limiter = Limiter(
|
||||||
bp,
|
|
||||||
key_func=get_remote_address,
|
key_func=get_remote_address,
|
||||||
default_limits=get_routes_limits(
|
default_limits=get_routes_limits(
|
||||||
args.req_limit, args.daily_req_limit, api_keys_db
|
args.req_limit, args.daily_req_limit, api_keys_db
|
||||||
@ -997,6 +996,8 @@ def create_app(args):
|
|||||||
else:
|
else:
|
||||||
app.register_blueprint(bp)
|
app.register_blueprint(bp)
|
||||||
|
|
||||||
|
limiter.init_app(app)
|
||||||
|
|
||||||
swag = swagger(app)
|
swag = swagger(app)
|
||||||
swag["info"]["version"] = get_version()
|
swag["info"]["version"] = get_version()
|
||||||
swag["info"]["title"] = "LibreTranslate"
|
swag["info"]["title"] = "LibreTranslate"
|
||||||
|
Loading…
Reference in New Issue
Block a user