闲置时间过后,Firebase实时数据库触发器不活动 [英] Firebase Realtime Database Trigger inactive after idle period
问题描述
我有一个带有Firebase功能的Firebase项目,该功能在对实时数据库中的节点进行更改时触发. 2个月前,我部署并测试了Firebase Functions,一切工作正常.现在,当我更新数据库中的节点时,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屋!