gpt4 book ai didi

python - Firestore .get() 导致超出截止日期

转载 作者:太空宇宙 更新时间:2023-11-03 14:15:30 25 4
gpt4 key购买 nike

我正在运行 the documentation 中的以下代码:

docs = db.collection(u'cities').get()

for doc in docs:
print(doc.id)

但我收到以下错误:

Traceback (most recent call last):
File "...", line 74, in <module>
main()
File "...", line 53, in main
for doc in docs:
File "/usr/lib/python2.7/site-packages/google/cloud/firestore_v1beta1/query.py", line 588, in get
for index, response_pb in enumerate(response_iterator):
File "/usr/lib/python2.7/site-packages/grpc/_channel.py", line 347, in next
return self._next()
File "/usr/lib/python2.7/site-packages/grpc/_channel.py", line 338, in _next
raise self
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with (StatusCode.DEADLINE_EXCEEDED, Deadline Exceeded)>

Python 库有问题吗?我什至没有运行任何查询或任何东西,所以我很惊讶简单的索引操作会超时。我也不知道如何进一步调试它,因为文档没有提到这样的事情。

最佳答案

事实证明,这是由于在 Linux 的 Windows 子系统上运行所致。显然,Firestore 在 WSL 上的性能非常慢(我认为是由于文件系统操作),默认超时太短。

关于python - Firestore .get() 导致超出截止日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48241016/

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