有没有办法停止正在运行的Firebase云功能实例-它陷入了无限循环

时间:2019-01-08 10:09:02

标签: firebase google-cloud-functions

我有一个包含以下代码的云功能:

exports.functionName = functions.https.onCall((data, context) => {
    //some logic
    b().then(function(otherData){
       //further logic
       resolve(otherDataModified)
    });
});

b = () => {
    if(someError){
      b();
      resolve(); //This is where i made the mistake, this should be returned after b has completed
    }else{
      resolve();
    }
}

现在的事情是,在意识到错误之前,我已经两次调用了此函数,这导致函数b进入无限循环,尽管请求已完成并得到解决,并且我向用户显示了错误,但仍有两个功能不断在后台运行,我看不到任何选项可以真正停止执行此操作。

还尝试使用正确的逻辑更新功能,新运行均正常运行,但此运行完全挂断,如果不检查会给我带来很多资源费用。

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:2)

您应该通过以下网址转到Google Cloud控制台(不是Firebase控制台)来删除Cloud Function:

https://console.cloud.google.com/functions/list?project=YOUR_PROJECT_NAME

您将看到一个表,其中列出了已部署的Cloud Functions:在每一行的末尾都有一个三个点的按钮。单击此按钮,然后选择“删除”。

相关问题