Firestore JS 客户端 httpsCallable 超时的最大超时是多少?

问题描述 投票:0回答:1

问题 执行代码 5 分钟 1 秒后,我不断收到此错误

node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[FirebaseError: internal] {
  code: 'functions/internal',
  customData: undefined,
  details: undefined
}

Node.js v22.1.0

这是我的客户代码

export const app = initializeApp(firebaseConfig);
const functions = getFunctions(app, "us-central1");
connectFunctionsEmulator(functions, "127.0.0.1", 5001);
const testFunction = httpsCallable(functions, 'doTask', {timeout: 1200000})
testFunction({url: "url", vid: "test6"})
.then((result) => console.log(result))

我的函数需要 10-15 分钟才能执行。该函数没有显示任何错误,并且在客户端崩溃后继续成功运行。我尝试绕过该函数立即返回,客户端工作得很好。但是我似乎找不到任何表明 JS 客户端超时限制的文档。

node.js firebase google-cloud-platform google-cloud-functions
1个回答
0
投票

该错误消息没有说明超时。如果是超时,我希望错误消息会具体说明这一点。 “功能/内部”通常意味着后端功能有问题。

但是,如果您想更改超时,这已在 API 文档中记录为 httpsCallable() 的第三个参数,该参数是 HttpsCallableOptions 对象。使用 timeout 属性。看起来你已经知道了。您可以期望它与客户端平台的底层最大超时一样长,这可能会根据您的浏览器或操作系统而有所不同。

如果您认为 SDK 无法正常工作,并且有清晰、简单的代码可供重现(后端和客户端),那么您应该在 GitHub 上提交错误报告。

© www.soinside.com 2019 - 2024. All rights reserved.