From f3aa8ac4bd69d98400be3da8025750dc05a9aaa9 Mon Sep 17 00:00:00 2001 From: zy123 <646228430@qq.com> Date: Sat, 15 Feb 2025 11:25:05 +0800 Subject: [PATCH] =?UTF-8?q?2.15=20=E6=B5=8B=E8=AF=95=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E4=B8=BA@require=5Fexecution=5Ftimeout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flask_app/routes/test_zbparse.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flask_app/routes/test_zbparse.py b/flask_app/routes/test_zbparse.py index 8d7dcff..d65d58c 100644 --- a/flask_app/routes/test_zbparse.py +++ b/flask_app/routes/test_zbparse.py @@ -14,11 +14,11 @@ test_zbparse_bp = Blueprint('test_zbparse', __name__) @require_execution_timeout(timeout=1800) def test_zbparse(): try: - return Response(stream_with_context(test_process_and_stream()), content_type='text/event-stream') + return test_process_and_stream() except Exception as e: # 使用 Flask 应用的日志记录器 current_app.logger.error('Exception occurred: ' + str(e)) - return jsonify({'error': str(e)}), 500 + return jsonify({'error': str(e)}) def test_process_and_stream(): data_segments = [