我有一個(gè) Flask 應(yīng)用程序,在嘗試將 Flask 與faust集成時(shí)出現(xiàn)此錯(cuò)誤。app.pyimport mode.loop.eventletimport loggingimport logging.configimport jsonfrom flask import Flaskfrom elasticapm.contrib.flask import ElasticAPMdef create_app():? ? app = Flask(__name__)? ? configure_apm(app)? ? configure_logging()? ? register_blueprints(app)? ? register_commands(app)? ? return appmain.pyfrom flask import jsonifyfrom litmus.app import create_appfrom intercepter import Intercepterapp = create_app()app.wsgi_app = Intercepter(app.wsgi_app , app)@app.route('/status')def status():? ? return jsonify({'status': 'online'}), 200另一個(gè)控制器@api_blue_print.route('/v1/analyse', methods=['POST'])def analyse():? ? analyse_with_historic_data.send(value=[somedata])? ? return jsonify({'message': 'Enqueued'}), 201analyse_with_historic_data.py@app.agent(analysis_topic)async def analyse_with_historic_data(self, stream):? ? async for op in stream:? ? ? ? entity_log = EntityLog.where('id', op.entity_log_id).first()我試圖通過(guò) monkey.patch_all 解決這個(gè)問(wèn)題,但它也沒(méi)有解決,給出了另一個(gè)無(wú)法釋放鎖的堆棧跟蹤。
greenlet.error:無(wú)法切換到不同的線程
墨色風(fēng)雨
2023-06-20 10:29:11