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

Time:06-07

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");
});

CodePudding user response:

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
});
  • Related