![](/img/trans.png)
[英]Couchbase Python SDK - How to enforce a custom couchbase connection timeout?
[英]How to check and set up the Couchbase timeout using the Python SDK?
我正在尋找一種方法來檢查 Couchbase 集群超時的當前值,以及如何使用 Python SDK 設置所需的超時。
我知道使用 ClusterTimeoutOptions 設置超時的方法,但它不起作用。
如果我使用 couchbase-cli 禁用它,超時沒有問題: couchbase-cli setting-query --set --timeout -1
我解決了它,它按我的預期工作。 我將在 Couchbase 文檔網站上找到的 cURL 命令轉換為 Python 的請求,並且能夠檢查超時並更新它。
檢查:requests.get('http://localhost:8093/admin/settings', auth=(user, password))
更新:requests.post('http://localhost:8091/settings/querySettings', headers=headers, data=data, auth=(user, password))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.