ios - 增加 Firebase HTTPs Callable iOS Swift 中的时间间隔
问题描述
我正在使用我的 iOS Swift 代码,并已成功安装所有依赖项。现在,我正在尝试增加 Firebase 函数中的 timeoutInterval。
functions.httpsCallable("getData").call(){ (result, error) in
guard error == nil else {
print(error)
return
}
.........
}
解决方案
你不能从客户端做到这一点。您将不得不增加函数的超时时间,如下所示:
const runtimeOpts = {
timeoutSeconds: 300,
memory: '1GB'
}
exports.getData = functions
.runWith(runtimeOpts)
https.onCall((data, ctx) = > {
// the function
});
timeoutSeconds 的最大值为 540,即 9 分钟。
详细信息可以在文档中找到
推荐阅读
- go - 我们可以在不“手动”构造的情况下在数组和结构之间进行转换吗?
- sql - 按缺失或无效分组。福克斯专业版 9
- javascript - 我不确定什么时候预渲染画布是合适的!(我在描述中的例子)
- apache-spark - 使用 spark sql 优化器优化两个范围连接
- node.js - Heroku部署后出现错误“请求的资源上不存在'Access-Control-Allow-Origin'标头”
- python-3.x - 如何在为 pyresttest 格式化的 yaml 文件中声明和使用变量?
- windows - 如何显示所有已更改的文件?
- python - 在嵌套多维数组中搜索多个值
- php - 无法从数据库中获取单列值
- r - downloadHandler 唯一地忽略同一用户正在进行的异步进程