firebasegoogle-cloud-functionstimeout

How to increase timeout when calling a Firebase Cloud Function?


I am calling a Firebase Cloud Function v1 via httpsCallable from the Browser. The GCF implementation sometimes takes over a minute. I have set :timeoutSeconds to 540 for this cloud function, so it runs successfully. But my function call in the browser crashes with:

"FirebaseError: deadline-exceeded"

I do net get the result from the successfull cloud function call.

How can I increase the timeout on the client (in the browser)?


Solution

  • Take a look at the API documentation for third parameter of httpsCallable(), which is a HttpsCallableOptions object. Use the timeout property to set the timeout.

    const functions = getFunctions(app)
    const callable = httpsCallable(functions, 'yourFunction', { timeout: ... })