firebase / firebase/firebase-admin-node

Getting Cold start latency of 5+ seconds even after using the preferRest option for firebase-admin

未关闭
#2,195 8 条评论 0 个 reaction 已指派 2 人 已被 @lahirumaramba 认领 在 GitHub 查看
api: firestore
主要语言
TypeScript
星标
1.7k
派生
419
平均合并
3 天 10 小时
30 天内合并 PR
16

描述

I was getting a cold start latency of 5+ seconds while using firestore database. I came across this age old issue- https://issuetracker.google.com/issues/158014637 and the solution here- https://github.com/firebase/firebase-admin-node/pull/1901 but even after implementing the solution as mentioned, I am still getting a latency of 5-6 seconds.

"firebase-admin": "^11.8.0" is the only dependencies I have.

Please find below my code snippet-
``
const { initializeApp } = require("firebase-admin/app");

const { initializeFirestore } = require("firebase-admin/firestore");

if (!isAlreadyInitialized) {
const app = initializeApp();
db = initializeFirestore(app, { preferRest: true });
isAlreadyInitialized = true;
}

const query = db.collection("apps").where("apiKey", "==", apiKey);

const querySnapshot = await query.get();
``
Do let me know in case of any other queries.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。