mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-01 06:48:11 +08:00
add config and init for server timings (#1368)
* add config and init for server timings * add missing config error check
This commit is contained in:
@@ -4,6 +4,7 @@ import logging
|
||||
from flask import Flask, redirect, current_app, make_response, render_template, abort
|
||||
from flask import Blueprint, request
|
||||
from flask_restful import Api, Resource
|
||||
from server_timing import Timing as ServerTiming
|
||||
|
||||
from http import HTTPStatus
|
||||
|
||||
@@ -235,6 +236,8 @@ class Server:
|
||||
self.app = Flask(__name__, static_folder="../common/web/static")
|
||||
self._before_adding_routes(app_config)
|
||||
self.app.json_encoder = Float32JSONEncoder
|
||||
if app_config.server__server_timing_headers:
|
||||
ServerTiming(self.app, force_debug=True)
|
||||
|
||||
# enable session data
|
||||
self.app.permanent_session_lifetime = datetime.timedelta(days=50 * 365)
|
||||
|
||||
Reference in New Issue
Block a user