如何增加 firebase 计划函数的内存限制?

Joh*_*rtl 1 javascript node.js firebase google-cloud-platform google-cloud-functions

文档提到了 using ,但是如何将此选项与预定函数一起使用,如下所示.runWith({memory: "1GB"})

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

Ren*_*nec 5

只需执行以下操作:

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
});
Run Code Online (Sandbox Code Playgroud)