本文介绍了重试Firebase的Cloud Functions,直到成功的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个云功能,该功能根据数据库中的更改发送电子邮件.我使用邮戳,但这与该功能无关.我查看了

编辑功能

点击链接以配置重试

启用失败重试"

对于您的用例,我还没有尝试过,但是当它失败时,它就可以用于我的存储触发功能.

I'd like to create a cloud function which sends an e-mail based on a change in my database. I use postmark, but that's not relevant for this function. I looked at the firebase-examples.

My question is: What if the mail service returns an error or if the mail service is temporary down? I don't see any form of error handling in the examples.

My 'solution' would be to try again in 5 minutes for example. Is that possible and advisable in cloud functions?

解决方案

If you throw an exception when sending the email fails, it should retry the function up to 7 days.

Open detailed usage states for your function in the firebase console

Edit the function

Click the link to configure retry

Enable "Retry on failure"

I haven't tried it myself yet for your use case, but it works for my storage triggered function when it fails.

这篇关于重试Firebase的Cloud Functions,直到成功的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 10:44