gpt4 book ai didi

python - 如何为 CloudError : Azure Error: RequestsLimitReached 添加客户端限制

转载 作者:行者123 更新时间:2023-12-03 03:57:25 26 4
gpt4 key购买 nike

创建 Azure 托管磁盘快照时出错。下面是异常堆栈和Azure云返回的消息

Exception call stack:
"Traceback (most recent call last):"
File ""azure/azure.py"", line 188, in createsnapshot"
disksnapshot = dsksnapshotcreation.result()"
File ""/tmp/myapp/libs/azure/lib/msrest/polling/poller.py"", line 183, in result"
elf.wait(timeout)"
File ""/tmp/myapp/libs/azure/lib/msrest/polling/poller.py"", line 201, in wait"
raise self._exception # type: ignore"
File ""/tmp/myapp/libs/azure/lib/msrest/polling/poller.py"", line 152, in _start"
self._polling_method.run()"
File ""/tmp/myapp/libs/azure/lib/msrestazure/polling/arm_polling.py"", line 400, in run"
raise CloudError(self._response)"
"msrestazure.azure_exceptions.CloudError: Azure Error: RequestsLimitReached"

消息:从可写资源(托管磁盘)复制的尝试过多;请使用快照源在短时间内创建多个副本。

看起来我需要添加某种客户端限制。但Azure python SDK并没有返回文档https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling中提到的节流信息.

如何使用Python SDK获取“retry-after”等信息?

最佳答案

您在调用 create_or_update() 时是否使用了 raw=True ?这样,SDK 轮询器就可以返回服务端返回的 http header 。

关于python - 如何为 CloudError : Azure Error: RequestsLimitReached 添加客户端限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64041155/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com