【发布时间】:2019-08-05 06:31:36
【问题描述】:
我需要在函数超时之前退出循环,为此在 AWS Lambda 中我们有 get_remaining_time_in_millis,我通常将其用于此目的。
do {
... // process the tasks in small batches that can be completed in, say, less than 10s
// when there's less than 10s left, stop
} while (context.getRemainingTimeInMillis() > 10000);
在 GCP 中是否有类似的方法来完成相同的任务?我试图避免调用 rest api 来获取函数配置并自己实现它。
【问题讨论】:
标签: python aws-lambda google-cloud-functions serverless