forked from alphagov/notifications-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapplication.py
More file actions
27 lines (18 loc) · 766 Bytes
/
application.py
File metadata and controls
27 lines (18 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
##!/usr/bin/env python
import os
from app.performance import init_performance_monitoring
init_performance_monitoring()
from app import create_app # noqa
from app.notify_api_flask_app import NotifyApiFlaskApp # noqa
import notifications_utils.eventlet as utils_eventlet # noqa
application = NotifyApiFlaskApp("app")
create_app(application)
if utils_eventlet.using_eventlet:
application.wsgi_app = utils_eventlet.EventletTimeoutMiddleware(
application.wsgi_app,
timeout_seconds=int(os.getenv("HTTP_SERVE_TIMEOUT_SECONDS", 30)),
)
if application.config["NOTIFY_EVENTLET_STATS"]:
import greenlet
greenlet.settrace(utils_eventlet.account_greenlet_times)
application._server_greenlet = greenlet.getcurrent()