Google Cloud Function不会终止过去的最大function持续时间

在“时间限制”部分的Google Cloud Functions文档中,它表示最长持续时间应该是540秒。 之后,云端function应该终止。

“最大function持续时间 – 一个function在被强行终止之前可以运行的最长时间 – 540秒

我已经对http-triggers进行了一些testing,并注意到如果在6秒内没有发回响应,函数将终止。

我还运行了另一个testing,立即发送回应,并每分钟asynchronouslogging一条消息。

目前40分钟后,它仍然在logging消息。

这里是代码片段:

function recursiveCallback (n) { console.log(`MarkTest: Callback Pass ${n}`); setTimeout(function () { recursiveCallback(n + 1); }, 1000 * 60); } exports.test_func = function (req, resp, callback) { console.log('Sending Response. response'); resp.send(''); console.log('Response Sent.'); console.log('Starting Async Polling'); recursiveCallback(0); console.log('test_func End') }; 

这是一个错误,还是这个故意?