You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 23, 2025. It is now read-only.
需求:定时调用
GCF思路1:在
GCF中使用setTimeout作为定时器,使用google pubsub再次publish消息到触发该GCF的TOPIC。当设置
GCF的超时时间为10秒,通过环境变量指定setTimeout的时间为15秒,会导致GCF超时。GCF超时日志:还有一个问题是,在
GCF中使用setTimeout会导致该GCF一直处在执行过程中,这样会导致费用上升,因为GCF的是根据调用次数和执行时间来收费的。参考:
https://stackoverflow.com/questions/51695859/is-it-ok-to-use-settimeout-in-cloud-functions
https://stackoverflow.com/questions/52416538/firebase-function-cant-run-settimeout-in-background-continuously-for-cron-job
https://stackoverflow.com/questions/42790735/cloud-functions-for-firebase-trigger-on-time