I keep getting a sporadic error from Cloud Functions for Firebase when converting a relatively small image (2mb). When successful, the function only takes about 2000ms or less t
You can set this from within your Cloud Function file on Firebase.
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
});
Take from the docs here: https://firebase.google.com/docs/functions/manage-functions#set_timeout_and_memory_allocation
Don't forget to then run firebase deploy from your terminal.