For older functions i was able to do this:
functions.runWith({timeoutSeconds: 120, memory: "1GB"})
How do we do this for a 2nd generation https.onCall()
function?
There does not seem to be any detailed instruction for this anywhere in Firebase’s documentation other than:
- A section here that does not cover
https.onCall()
functions - A section here that also does not cover
https.onCall()
functions
This SO reference question is NOT a duplicate given that it does not refer to setting an increase for the timeout nor the memory for an onCall()
function.
I was not able to find any question on SO specific to this exact question.
2
Answers
One solution is to set the increase inside the
firebase.json
configuration file as follows, whereasFUNCTION_NAME
would need to be set to the name of the exported function in my source code:export const FUNCTION_NAME = functions.https.onCall( async (request:any) => {
It seems it is possible to simply set both as the first argument of
onCall()
although i am not able to find this in Firebase’s documentation:export const FUNCTION_NAME = functions.https.onCall({timeoutSeconds: 120, memory: "2GiB"}, async (request:any) => {