How do you change execution timeout for a Google Cloud Function running a ExpressJS service in code?
I found the documentation for Google Functions to change the default timeout of 60 seconds for a simple function.
https://cloud.google.com/functions/docs/concepts/exec
exports.afterTimeout = (req, res) => {
setTimeout(() => {
// May not execute if function's timeout is <2 minutes
console.log('Function running...');
res.end();
}, 120000); // 2 minute delay
};
Express
const express = require('express');
const app = express();
...
module.exports.app = app;
Thanks