From b17fd21bb88c407d8244325206ec0032c0cb7d6c Mon Sep 17 00:00:00 2001 From: Alexey Bezhan Date: Fri, 30 Nov 2018 16:20:08 +0000 Subject: [PATCH] Revert "Enable pessimistic DB connection disconnect handling" Once the DB upgrade is complete we no longer want the added overhead of "pre-ping" connection check. --- app/__init__.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index eea36a485..b4a470ac0 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -4,7 +4,7 @@ import string import uuid from flask import _request_ctx_stack, request, g, jsonify -from flask_sqlalchemy import SQLAlchemy as _SQLAlchemy +from flask_sqlalchemy import SQLAlchemy from flask_marshmallow import Marshmallow from flask_migrate import Migrate from time import monotonic @@ -27,13 +27,6 @@ from app.encryption import Encryption DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%S.%fZ" DATE_FORMAT = "%Y-%m-%d" - -class SQLAlchemy(_SQLAlchemy): - def apply_pool_defaults(self, app, options): - _SQLAlchemy.apply_pool_defaults(self, app, options) - options["pool_pre_ping"] = True - - db = SQLAlchemy() migrate = Migrate() ma = Marshmallow()