remove limitter
This commit is contained in:
parent
cd9fc4755e
commit
802af2418a
|
@ -6,7 +6,6 @@ from flask_sqlalchemy import SQLAlchemy
|
||||||
import os
|
import os
|
||||||
from config import config
|
from config import config
|
||||||
from flask_security.forms import LoginForm
|
from flask_security.forms import LoginForm
|
||||||
from flask_limiter import Limiter
|
|
||||||
from flask_limiter.util import get_remote_address
|
from flask_limiter.util import get_remote_address
|
||||||
|
|
||||||
from .forms import *
|
from .forms import *
|
||||||
|
@ -15,13 +14,6 @@ from .forms import *
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
app.config.from_object(config[os.getenv('FLASK_CONFIG') or 'default'])
|
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)
|
@app.errorhandler(429)
|
||||||
def ratelimit_handler(e):
|
def ratelimit_handler(e):
|
||||||
|
|
|
@ -4,7 +4,7 @@ from flask_security.core import current_user
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from ..entities import FillingStation
|
from ..entities import FillingStation
|
||||||
from .. import app, db, limiter
|
from .. import app, db
|
||||||
|
|
||||||
|
|
||||||
@app.route('/filling_stations/favourites/toggle/<fsid>')
|
@app.route('/filling_stations/favourites/toggle/<fsid>')
|
||||||
|
@ -24,7 +24,6 @@ def add_favourite_filling_stations(fsid):
|
||||||
|
|
||||||
@app.route('/filling_stations', methods=['GET'])
|
@app.route('/filling_stations', methods=['GET'])
|
||||||
@login_required
|
@login_required
|
||||||
@limiter.limit('1 per second')
|
|
||||||
def query_filling_stations():
|
def query_filling_stations():
|
||||||
api_key = app.config['TANKERKOENIG_API_KEY']
|
api_key = app.config['TANKERKOENIG_API_KEY']
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue