Firebase 实时数据库触发器在空闲期后处于非活动状态 [英] Firebase Realtime Database Trigger inactive after idle period
问题描述
我有一个 Firebase 项目,它带有一个 Firebase 函数,当实时数据库中的一个节点发生更改时会触发该函数.我在 2 个月前部署并测试了 Firebase 功能,一切正常.当我现在更新数据库中的节点时,Firebase 函数不再触发.为什么不再触发 Firebase 功能?数据库侦听器是否在一段时间不活动后被禁用?我不认为这是由于实例启动时间造成的,因为在等待几分钟后,该功能仍未触发.当我重新部署完全相同的功能时,一切都会再次运行.
I have a Firebase project with a Firebase Function that triggers when changes are made to a node in the Realtime Database. I deployed and tested the Firebase Functions 2 months ago and everything was working fine. When I now update a node in the database the Firebase Function does not trigger anymore. Why is the Firebase Function not triggered anymore? Are the database listeners disabled after a certain period of inactivity? I dont think this is due to the instance spin up time because after several minutes of waiting the function was still not triggered. When I redeploy the exact same functions everything works again.
推荐答案
更新日期:2019 年 3 月 22 日
请参阅下面 Firebase 团队成员的评论:
See comment below by Firebase team member:
从今天开始,此限制已被删除.您将不得不重新部署你的云函数最后一次,但在那之后他们不应该30 天后自动删除.
This limitation was removed as of today. You will have to redeploy your Cloud Functions one final time, but after that they shouldn't be auto-removed after 30 days anymore.
<小时>
我没有在 Firebase 文档中找到此问题,但它在 Google Cloud 文档中:
后台功能的最长不活动时间 = 30 天
Max inactivity time for background functions = 30 days
后台功能可以保留的最长时间没有任何调用.一次都没有调用的函数在此期间可能会进入新事件不会发生的状态再触发它们.如果发生这种情况,这些功能必须重新部署以重新开始工作.注意:这种非活动状态不是以任何方式反映在 UI、CLI 或 API 中.
The maximum amount of time that a background function can be kept without any invocation. Functions that are not invoked even once during this time may enter a state in which new events will not trigger them anymore. If this happens, such functions have to be redeployed to start working again. Note: This inactive state is not reflected in the UI, CLI, or API in any way.
他们现在已将其添加到 firebase 文档中:文档链接
They have added it in the firebase documentation now: documentation link
这篇关于Firebase 实时数据库触发器在空闲期后处于非活动状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!