【发布时间】:2021-08-09 13:17:05
【问题描述】:
我正在使用 Firebase 函数并通过以下 Firebase 托管重写来公开它们:
{
"hosting": {
"public": "build",
"headers": [
{
"source": "/service-worker.js",
"headers": [
{
"key": "Cache-Control",
"value": "no-cache"
}
]
}
],
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
// functions
{ "source": "/mappedUrlOne", "function": "functionOne" },
{ "source": "/mappedUrlTwo", "function": "functionTwo" },
// landing page
{
"source": "**",
"destination": "/index.html"
}
]
}
当对映射的 URL(例如 /mappedUrlOne)运行重复调用时,函数在大约 50% 的时间间歇性地失败并出现 500 Internal Error。丢弃的请求甚至不会在 Firebase 日志中注册,并且会在 200-300 毫秒内失败。
如果我直接调用该函数(例如https://us-central1-my-project-name.cloudfunctions.net/functionOne),一切都会顺利。
这些映射已经部署并工作了一段时间,可能一年多,所以那里没有任何变化。
【问题讨论】:
标签: firebase google-cloud-platform google-cloud-functions firebase-hosting