Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How do I increase the memory limit of firebase scheduled functions?

The documentation mentions using .runWith({memory: "1GB"}), but how do I use this option with a scheduled function like this:

functions.pubsub.schedule('every 10 minutes').onRun(async (context) => {
    console.log("Do something");
});

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Just do as follows:

functions.runWith({memory: "1GB"}).pubsub.schedule('every 10 minutes').onRun(async (context) => {
    console.log("Do something");
    // Don't forget to return a Promise if necessary!! 
    // See https://firebase.google.com/docs/functions/terminate-functions
});
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading