Google Cloud Function Environmnet定时了解每项功能 [英] Google Cloud Function Environmnet Timing out on every functions
问题描述
编辑:我不得不回滚到:npm install firebase-functions@v1.10 --save
因为显然v2.0.0有一些系统中断更改。我可能会提出一个单独的问题并回答它,希望这里的一些firebase团队可以给我们更多的洞察力。
I had to rollback to : npm install firebase-functions@v1.10 --save Because apparently v2.0.0 has some system breaking changes. I'll probably make a separate question and answer it in the hopes that some of firebase team here on SO can give us more insight.
我不知道发生了什么但昨天突然之间我的每一个谷歌云功能开始花了整整60秒(GCF的默认超时限制)。我甚至将所有代码完全复制到了姐妹项目环境中,代码运行顺畅,没有超时,所以我相信它的所有环境,而不是代码本身。
I don't know what happen but yesterday out of the blue every single one of my google cloud functions began taking the whole 60 seconds (the default timeout limit of GCF). I even copied the all of the code completely into a sister projects environment and and the code ran smoothly with no timeouts so I believe its all the environment and not the code itself.
有没有人可以建议调查或测试我可以运行调查的原因?我也开放了一些重启重启。
Is there anything anyone can suggest looking into or tests I could run to investigate the cause of this? I am also open to some restart reboot.
我将一个功能简化为低于第一个环境但不是第二个环境的超时。但请记住,我真的不认为它与个别功能有任何关系。
I simplified a function down below that is timing out in the first environment but not the second. But Again remember I really don't think it has anything to do with individual functions.
exports.triggerRegularly = functions.storage.bucket("xxxxxxx.appspot.com").object().onFinalize((object) => {
console.log("Hey", object);
console.log("Hey Again", privateKey);
console.log("Hey Again2", os.tmpdir());
return object;
})
以下是运行此功能的日志示例(当我意识到明显的问题时,我将超时从60秒更改为30秒原因:
Here is an example Log from running this function (I changed the timeout from 60s to 30s when I realized the issue for obvious reasons:
2:00:22.605 AM triggerRegularly Function execution took 30003 ms, finished with status: 'timeout'
1:59:52.990 AM triggerRegularly Hey Again2 /tmp
1:59:52.989 AM triggerRegularly Hey Again -----BEGIN RSA PRIVATE KEY----
-----END RSA PRIVATE KEY-----
1:59:52.980 AM triggerRegularly Hey { bucket: xxxxxxxx}
1:59:52.604 AM triggerRegularly Function execution started
编辑:结果v2.0.0可能会被直接打破,很多人遇到这个问题。
edit: Turns out v2.0.0 might be straight up broken, tons of people are encountering this issue.
https: //github.com/firebase/firebase-functions/issues/283
推荐答案
现已修复此问题firebase-functions v2.0.1。通过在函数文件夹中运行以下命令进行升级:
This has now been fixed in firebase-functions v2.0.1. Upgrade by running the following in your functions folder:
npm i firebase-functions @ latest --save
npm i firebase-functions@latest --save
这篇关于Google Cloud Function Environmnet定时了解每项功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!