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
Starting functions v2.0.0 you can also set the timeout in your function declaration as described in the doc under the "Set timeout and memory allocation" section:
const runtimeOpts = {
timeoutSeconds: 300,
memory: '1GB'
}
exports.myStorageFunction = functions
.runWith(runtimeOpts)
.storage
.object()
.onFinalize((object) = > {
// do some complicated things that take a lot of memory and time
});
As release notes also highlighted:
You will need firebase-tools >=v4.0.0.
And on Mac you can get the latest firebase-tools
with the following command:
npm install -g firebase-tools
Also note the limitations and valid values as per the doc link above:
The maximum value for timeoutSeconds is 540, or 9 minutes.
Valid values for memory are:
128MB
256MB
512MB
1GB
2GB
Per @MichaelBleigh's comment. This has been resolved in the latest version of the Firebase CLI (3.7.0 at the time of this post).
If you are still experiencing this issue, make sure you are using the latest version of the Firebase CLI.
Default timeout can be changed here https://console.cloud.google.com/functions/list
select function
>test function
> edit
> timeout
After you select your function and then press "Edit" it is located under the "More" drop-down at the bottom of the page. The current max is 540 seconds.