From 83b9970d67f979ed49da9a99fa9610927f8a4c17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B4=94=E4=B8=BA=E4=B9=8B?= <560397@gree.com.cn> Date: Tue, 7 Nov 2023 15:41:12 +0800 Subject: [PATCH] Update project --- application/libs/flask_elasticsearch/elasticsearch.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/application/libs/flask_elasticsearch/elasticsearch.py b/application/libs/flask_elasticsearch/elasticsearch.py index b2128dd..600ac33 100644 --- a/application/libs/flask_elasticsearch/elasticsearch.py +++ b/application/libs/flask_elasticsearch/elasticsearch.py @@ -15,21 +15,13 @@ from typing import Any from elasticsearch import Elasticsearch from flask import Flask +from flask import _app_ctx_stack as stack_context from flask_elasticsearch import FlaskElasticsearch as BaseFlaskElasticsearch from loguru import logger from application.common import ConfigHelper -# Find the stack on which we want to store the database connection. -# Starting with Flask 0.9, the _app_ctx_stack is the correct one, -# before that we need to use the _request_ctx_stack. -try: - from flask import _app_ctx_stack as stack_context -except ImportError: - from flask import _request_ctx_stack as stack_context - - class FlaskElasticsearch(BaseFlaskElasticsearch): def __init__(self, app=None, **kwargs): """ -- GitLab