我已经使用python编写了HTTP触发函数。目的是从集合中流式传输文档,并将文档中的数据用于计算。
collections = db.collection('practices').document(practiceAdminEmail).collections()
for collection in collections:
for data in collection.stream():
#data from the documents and computation.
Traceback (most recent call last): File "/env/local/lib/python3.7/site-
packages/google/api_core/grpc_helpers.py", line 97, in next return six.next(self._wrapped)
File "/env/local/lib/python3.7/site-packages/grpc/_channel.py", line 416, in __next__ return
self._next() File "/env/local/lib/python3.7/site-packages/grpc/_channel.py", line 689, in
_next raise self grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC
that terminated with: status = StatusCode.DEADLINE_EXCEEDED details = "Deadline Exceeded"
debug_error_string = "{"created":"@1600779766.265431225","description":"Error received from
peer ipv4:74.125.129.95:443","file":"src/core/lib/surface/call.cc","file_line":1061,
"grpc_message":" Deadline Exceeded","grpc_status":4}" > The above exception was the direct
cause of the following exception: Traceback (most recent call last): File
"/env/local/lib/python3.7/site-packages/google/cloud/functions/worker_v1.py", line 359, in
run_http_function result = _function_handler.invoke_user_function(flask.request) File
"/env/local/lib/python3.7/site-packages/google/cloud/functions/worker_v1.py", line 222, in
invoke_user_function return call_user_function(request_or_event) File
"/env/local/lib/python3.7/site-packages/google/cloud/functions/worker_v1.py", line 215, in
call_user_function return self._user_function(request_or_event) File "/user_code/main.py",
line 81, in pdfRegenerate for data in collection.stream(): File
"/env/local/lib/python3.7/site-packages/google/cloud/firestore_v1/query.py", line 862, in
stream for response in response_iterator: File "/env/local/lib/python3.7/site-
packages/google/api_core/grpc_helpers.py", line 100, in next
six.raise_from(exceptions.from_grpc_error(exc), exc) File "<string>", line 3, in raise_from
google.api_core.exceptions.DeadlineExceeded: 504 Deadline Exceeded
这是我遇到的错误。仅当文档数量更多时才会出现此错误。我可以在这方面获得帮助吗?