我创建了一个谷歌云源存储库,并在 main.py (在我的根目录中)中添加了以下内容
def sample_function(event, context):
print('inside sample_function')
return True
我使用以下命令部署了该函数:
$ gcloud beta functions deploy sample_function \
--entry-point sample_function \
--runtime python37 \
--source https://source.developers.google.com/projects/project_id/repos/repository_id/moveable-aliases/my_branch_name \
--region europe-west1 \
--trigger-event providers/cloud.firestore/eventTypes/document.create \
--timeout 60s \
--trigger-resource projects/my_project_id/databases/default/documents/finalDb/{orgId}/tasks/{taskId}
函数已成功部署,如图:
但是当在指定的触发路径添加文档时,云函数不会被触发。我检查了云函数日志,日志中没有任何条目显示该函数已执行。
可能是什么问题?我在部署过程中遗漏了什么吗?
P.S 我使用内联编辑器编写了类似的函数,它们似乎工作正常
最佳答案
关于python - 从云源存储库部署时不会触发 Firestore 云功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51664813/