我正在编写一个Flask API,并且在负载测试时看到很多失败。48, in wrapper File "/ariel/anaconda3/lib/python3.7/site-packages/connexion):Getting data and status code -更新 当我停止cx_Or
一个非常方便的解决方案似乎是使用WSGI中间件和ClosingIterator,如中所概述的。但是,每个点的处理程序需要知道哪个端点处理请求,以便执行他们的死后任务。更好的是,如果我编写了一个通用的@app.after_response处理程序(就像同一个作者在中所写的那样),我可以确定其中使用了哪个端点来处理请求吗?编辑:尝试使用flask.request.url_rule.endpoint的引发异常:
RuntimeError: Working outside of request context.