当我试图通过下面的代码更新每个文档时,我的集合大约有20000个文档;我得到这个错误:Error: 9 FAILED_PRECONDITION: The 'read_time' cannot be more than 270 seconds in the past. The requested value was '2021-05-11T19:09:49.064209Z', but the minimum allowed value was '2021-05-11T19:10:23.865748Z'.
我试图通过使用批处理来解决这个问题,但没有成功。有什么建议吗?
exports.scheduledFunctionFilms = functions.runWith(runtimeOpts).region('europe-west3').pubsub.schedule('0 05 * * 0').timeZone('Europe/Istanbul').onRun((context) => {
db.collection('Films').get().then(querySnapshot => {
if (querySnapshot.empty) {
console.log("null film")
return null;
} else {
const promises = []
console.log("started film")
querySnapshot.forEach(doc => {
promises.push(doc.ref.update({sectionPoint:0}));
});
console.log("finished film")
return Promise.all(promises);
}
}).catch(error => {
console.log('uncaught error film: ', error);
});
我想,5月11日谷歌云Firestore出现了问题(https://status.cloud.google.com/incidents/VVJnin9xh36NeBQ7Ut3c)。我在5月20日也得到了同样的结果。