0
我们有一个Firebase功能,可以在24小时后删除项目。该功能的作品,但是,链接到该功能的网页保持运行,所以我猜这个功能是无止境的循环。有没有办法解决这个问题?云端功能继续运行
这是我们的功能:
exports.delete = functions.https.onRequest((req, res) => {
const currentTime = new Date().getTime();
const dayAgo = currentTime - 86400000;
ref.child('testlijst')
.orderByChild('tijd')
.endAt(dayAgo)
.once('value')
.then(snap => {
snap.forEach(c => {
c.ref.remove();
})
});
});