Schedule jobs in Firebase

假装没事ソ 提交于 2021-02-08 11:36:56

问题


I am assuming that someone has reserved 4:30 now and wants to save it to the server and notify the server from the server at 4:30.

I do not want to use the alarm system built into the smartphone.

I also watched Firebase cloud function lectures on YouTube and implemented them. And I've also seen CronJobs, which gets into the URL by alarm on time and executes the function. I have to set the time for the user and give an alarm to each individual.


回答1:


There is no straight forward way of doing this, but you can go ahead and create a custom scheduler to work around it. A great article with step by step instructions was released by the angularfirebase people at:

https://angularfirebase.com/lessons/scheduled-tasks-and-cron-jobs-with-firebase/




回答2:


You may want to look at schedule functions looks like you can do something like:

export scheduledFunction = functions.pubsub.schedule('every 5 minutes')
.onRun((context) => {
  console.log('This will be run every 5 minutes!');
});


来源:https://stackoverflow.com/questions/46645164/schedule-jobs-in-firebase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!