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 = [