admin管理员组文章数量:1414628
I have the following function in my code:
async def context(client_id: str)
database = f'db_{client_id}'
await init_beanie(
database=database,
document_models=[
.. # quite a few models
],
)
Every time I fetch something from the database I will execute above function (it could be a different client every time).
I don't know exactly what init_beanie
does, but it seems there is an overhead calling it every time.
I looked through the docs and couldn't find something like a connection pool or similar. Does such thing exist or is it not necessary?
本文标签: pythonConnection pool for beanieStack Overflow
版权声明:本文标题:python - Connection pool for beanie? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745170048a2645917.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论