从云源存储库部署时不会触发Firestore云功能 [英] Firestore cloud functions not triggered when deployed from cloud source repository

查看:107
本文介绍了从云源存储库部署时不会触发Firestore云功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个google cloud源存储库,并将以下内容添加到main.py中(在我的根目录中)

I created a google cloud source repository and added the following in main.py (in my root directory)

def sample_function(event, context):
    print('inside sample_function')
    return True

我使用以下命令部署了该功能:

I deployed the function using the following command:

 $ 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}

该功能已成功部署,如下所示:

The function was deployed successfully as shown:

但是在指定的触发路径中添加文档时,不会触发云功能.我检查了云功能日志,并且日志中没有条目显示该功能已执行.

But the cloud function is not triggered when a document is added at the specified trigger path.I checked the cloud function logs and there was no entry in the log to showcase that the function executed.

可能是什么问题?我在部署过程中是否缺少任何东西?

What could be the issue? Am I missing something during deployment?

P.S我使用内联编辑器编写了类似的函数,它们似乎运行良好

P.S I wrote the similar functions using the inline editor and they seem to work fine

推荐答案

Python和gcloud当前不支持特定于Firebase的触发器(包括Firestore).

Firebase-specific triggers (including Firestore) are currently not supported for python and gcloud.

编辑

gcloud现在支持在以下环境中编写和部署 Firestore触发器所有受支持的语言.

gcloud now has support for writing and deploying Firestore triggers in all supported languages.

这篇关于从云源存储库部署时不会触发Firestore云功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆