Skip to content

Commit bbe64af

Browse files
author
Aaron Suarez
authored
Merge pull request #392 from OperationCode/remove-rate-limiting
Remove rate limiting for now
2 parents 7653a62 + 6b4f50f commit bbe64af

File tree

4 files changed

+180
-251
lines changed

4 files changed

+180
-251
lines changed

Diff for: app/__init__.py

-13
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
from flask import Flask
55
from flask_migrate import Migrate
66
from flask_sqlalchemy import SQLAlchemy
7-
from flask_limiter import Limiter
8-
from flask_limiter.util import get_remote_address
9-
from werkzeug.middleware.proxy_fix import ProxyFix
10-
from os import environ
117

128
from healthcheck import HealthCheck
139
# from healthcheck import EnvironmentDump
@@ -22,13 +18,6 @@
2218
index = search_client.init_index(Config.INDEX_NAME)
2319

2420
app = Flask(__name__, static_folder='app/static')
25-
if environ['FLASK_ENV'] != 'development':
26-
app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_host=1)
27-
limiter = Limiter(
28-
app,
29-
key_func=get_remote_address,
30-
default_limits=["200 per day", "50 per hour"]
31-
)
3221

3322
app.config.from_object(Config)
3423
app.url_map.strict_slashes = False
@@ -47,15 +36,13 @@
4736

4837

4938
@app.route("/healthz")
50-
@limiter.exempt
5139
def healthz():
5240
health = HealthCheck()
5341
health.add_section("application", application_data)
5442
return health.run()
5543

5644

5745
# @app.route("/environment")
58-
# @limiter.limit("1 per hour")
5946
# def environment():
6047
# envdump = EnvironmentDump()
6148
# envdump.add_section("application", application_data)

0 commit comments

Comments
 (0)