如何在python上在AWS OpenSearch库上指定超时
我正在使用 https://opensearch.org/docs/latest/latest/clients/clients/python/ 要与OpenSearch实例进行交互,
client = OpenSearch(
hosts=[{'host': host, 'port': port}],
http_auth=auth,
use_ssl=True,
verify_certs=True,
connection_class=RequestsHttpConnection,
----> request_timeout=100000 <-----
)
但我需要以某种方式可以轻松地延长请求的寿命。我搜索了文档,但找不到timeout
参数。
有没有办法指定超时?
I am using https://opensearch.org/docs/latest/clients/python/ to interact with an opensearch instance
client = OpenSearch(
hosts=[{'host': host, 'port': port}],
http_auth=auth,
use_ssl=True,
verify_certs=True,
connection_class=RequestsHttpConnection,
----> request_timeout=100000 <-----
)
but I need somehow to to extend the lifetime of the request easily. I searched the docs and I couldn't find a timeout
parameter.
Is there a way to specify a timeout?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
创建它时,您可以将
timeout = 60
(或其他)传递给OpenSearch对象。这将传递到下划线连接对象。You can pass
timeout=60
(or whatever) to the OpenSearch object when you create it. This gets passed to the underline connection object.