firebase / firebase/firebase-admin-node

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

Đang mở
#2,195 8 bình luận 0 reaction 2 người được giao Được @lahirumaramba nhận Xem trên GitHub
api: firestore
Ngôn ngữ chính
TypeScript
Star
1.7k
Fork
419
Merge trung bình
3 ngày 10 giờ
Pull request đã merge (30 ngày)
16

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.