Firebase / Parse可以每天在特定时间运行代码吗? [英] Can Firebase/Parse run code at a certain time every day?

查看:131
本文介绍了Firebase / Parse可以每天在特定时间运行代码吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Firebase或Parse可以设置类似cron的工作吗?
有没有办法设置某种运行在存储的用户数据上的定时操作?例如,我正在编写一个程序,允许人们每天午餐RSVP。如果您中午有RSVP,那么您会与其他已经RSVP的人配对。使用JavaScript,用户可以在浏览器中提交RSVP。



问题是,Firebase / Parse可以在每天中午12:00的时候执行代码以匹配每个人吗? / p>

解决方案

是的,这可以通过Parse完成。您需要将<后台作业的匹配函数写入云码,然后你需要在仪表板中安排任务。就计划的灵活性而言,它不像cron那样灵活,但你可以确定每天同时运行一个任务,或者每分钟运行一次。



任务可能需要15分钟才能执行,因此根据数据库的大小或任务的复杂程度,您可能需要将其分解为不同的任务或使其可恢复。


Is it possible on Firebase or Parse to set up something kinda like a cron job? Is there a way to set up some sort of timed operation that runs over the stored user data?

For example, I'm writing a program that allows people to RSVP for lunch everyday. If you have RSVPed by noon, then you get paired up with somebody else who has also RSVPed. Using JavaScript, the user can submit their RSVP in the browser.

The question is, can Firebase/Parse execute the code to match everyone at 12:00pm every day?

解决方案

Yes, this can be done with Parse. You'll need to write your matching function as a background job in cloud code, and then you'll need to schedule the task in the dashboard. In terms of the flexibility in scheduling, it's not as flexible as cron but you can definitely run a task at the same time every day, or every x minutes/hours.

Tasks can take 15 mins max to execute before they're killed, so depending on the size of your database or the complexity of your task, you may need to break it up into different tasks or make it resumable.

这篇关于Firebase / Parse可以每天在特定时间运行代码吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆