Monday 12 July 2021

How to move from Firebase Functions to Cloud Run after encountering 540s timeout limit?

I was reading this Reddit thread where a user mentioned that 540s is the limit of Firebase Functions and that moving to Cloud Run was recommended.

As others have said 540s is the maximum timeout and if you want to increase it without changing much else about your code, consider moving to Cloud Run. ​- @samtstern on Reddit

After looking at the Node.JS QuickStart documentation and other content on YouTube and Google, I did not find a good guide explaining how to move your Firebase Function to Cloud Run.

One of the issues that were not addressed by what I read, for example: what do I replace the firebase-functions package with to define the function? Etc...

So, how may I move my Firebase Function over to Cloud Run to not run into the 540s max timeout limitation ?

​const functions = require('firebase-functions');
​const runtimeOpts = {timeoutSeconds: 540,memory: '2GB'}
​exports.hourlyData = functions.runWith(runtimeOpts).pubsub.schedule('every 1 hours')


from How to move from Firebase Functions to Cloud Run after encountering 540s timeout limit?

No comments:

Post a Comment