fastapi:访问pydantic验证器内部的redis缓存
我知道通常不建议在pydantic验证器内执行任何IO操作(请参阅“ noreflow noreferrer”> https://github.com/tiangolo/fastapi/issues/979 )。但是,我尚不清楚是否可以在验证器内部执行Asyncio操作。
例如,如果我有一个验证器,可以调用等待redis.get()
是否会受到重大的负性命中?
I'm aware that it is typically not recommended to perform any IO operations inside of a Pydantic validator (see https://github.com/tiangolo/fastapi/issues/979). However, what is not clear to me is if asyncio operations are OK to perform inside of the validator.
For example, if I have a validator that calls await redis.get()
is that going to have a significant negative performance hit?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论