具有Firestore的Firebase Cloud功能返回“截止日期超出” [英] Firebase Cloud Function with Firestore returning "Deadline Exceeded"
问题描述
我从Firestore文档中获取了一个示例函数,并且能够从我的本地firebase环境成功运行它。但是,一旦我部署到我的firebase服务器,该功能就完成了,但是没有在firestore数据库中创建任何条目。 firebase功能日志显示截止日期已超过。我有点困惑。任何人都知道为什么会发生这种情况以及如何解决这个问题?
I took one of the sample functions from the Firestore documentation and was able to successfully run it from my local firebase environment. However, once I deployed to my firebase server, the function completes, but no entries are made in the firestore database. The firebase function logs show "Deadline Exceeded." I'm a bit baffled. Anyone know why this is happening and how to resolve this?
以下是示例函数:
exports.testingFunction = functions.https.onRequest((request, response) => {
var data = {
name: 'Los Angeles',
state: 'CA',
country: 'USA'
};
// Add a new document in collection "cities" with ID 'DC'
var db = admin.firestore();
var setDoc = db.collection('cities').doc('LA').set(data);
response.status(200).send();
});
推荐答案
Firestore有限制。
Firestore has limits.
可能因为限制而超出截止日期。
Probably "Deadline Exceeded" happens because of its limits.
请参阅此内容。 https://firebase.google.com/docs/firestore/quotas
每秒1次文档的最大写入率
Maximum write rate to a document 1 per second
https://groups.google.com/forum /#!msg / google-cloud-firestore-discuss / tGaZpTWQ7tQ / NdaDGRAzBgAJ
这篇关于具有Firestore的Firebase Cloud功能返回“截止日期超出”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!