Update: I updated the question, to reflect what I described in the body of the question, and what was happening at the time. It also justifies why I did not mark Sanyam's response as correct. There was a bug in the Console that was causing the timeout values to be ephemeral. @MichaelBleigh's response was the most pertinent, letting me know when the issue was resolved.
我有一个Cloud Function,在某些边缘情况下需要超过默认的60秒超时 .
问题是,虽然可以在Google Cloud Developer Console的“ Cloud 功能”部分更改此值,但在每次部署后它都会恢复为原始默认值 .
有没有办法可以将更改保留在此设置中,可能是在其中一个Firebase配置文件中?
4 回答
选择功能然后按“编辑”后,它位于页面底部的“更多”下拉菜单下方 . 当前最大值为540秒 .
从functions v2.0.0开始,您还可以按照"Set timeout and memory allocation"部分下的文档中的说明在函数声明中设置超时:
发行说明也强调:
在Mac上,您可以使用以下命令获取最新的
firebase-tools
:默认超时可以在这里更改https://console.cloud.google.com/functions/list
select function
>test function
>edit
>timeout
Per @ MichaelBleigh的评论 . 这已在最新版本的Firebase CLI中解决(本文发布时为3.7.0) .
如果您仍遇到此问题,请确保使用的是最新版本的Firebase CLI .