remove limitter

This commit is contained in:
Joachim Lusiardi 2023-04-17 21:25:02 +02:00
parent cd9fc4755e
commit 802af2418a
2 changed files with 1 additions and 10 deletions

View File

@ -6,7 +6,6 @@ from flask_sqlalchemy import SQLAlchemy
import os
from config import config
from flask_security.forms import LoginForm
from flask_limiter import Limiter
from flask_limiter.util import get_remote_address
from .forms import *
@ -15,13 +14,6 @@ from .forms import *
app = Flask(__name__)
app.config.from_object(config[os.getenv('FLASK_CONFIG') or 'default'])
# applies to all routes, so choose limits wisely!
limiter = Limiter(
app,
key_func=get_remote_address,
# default_limits=["500 per second"]
)
@app.errorhandler(429)
def ratelimit_handler(e):

View File

@ -4,7 +4,7 @@ from flask_security.core import current_user
import requests
from ..entities import FillingStation
from .. import app, db, limiter
from .. import app, db
@app.route('/filling_stations/favourites/toggle/<fsid>')
@ -24,7 +24,6 @@ def add_favourite_filling_stations(fsid):
@app.route('/filling_stations', methods=['GET'])
@login_required
@limiter.limit('1 per second')
def query_filling_stations():
api_key = app.config['TANKERKOENIG_API_KEY']