Parse.com 云代码每 n 分钟调度一次 [英] Parse.com cloud code schedule every n minutes

查看:56
本文介绍了Parse.com 云代码每 n 分钟调度一次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在 Parse 云代码上运行函数,以便按顺序向用户发送推送通知.例如向用户 1 发送推送,5 分钟后向用户 2 发送推送等?我的意思是我可以在 n 分钟后安排或调用某个函数.将不胜感激任何帮助.谢谢

Can I run function on Parse cloud code that will send push notifications to users in order. For example send push to user1, after 5 min send push to user2, etc? I mean could I schedule or invoke some function after n minutes for example. Will be grateful for any help. Thanks

推荐答案

您可以安排后台作业.根据需要创建作业,例如:

You can schedule background jobs. Create a job as you wish, for example:

Parse.Cloud.job("my_job", function(request, response) {
    response.success("Ran scheduled job.");
});

将其部署到您的 Parse 应用程序并转到您的 Cloud Code 仪表板,然后点击 Scheduled Jobs.从那里,点击Schedule a Job 并设置它应该被调用的第一次和它的频率.只需保存它,你就准备好了!:)

Deploy that to your Parse App and go to your Cloud Code dashboard, then click on Scheduled Jobs. From there, click on Schedule a Job and set up the first time it should be called and it's frequency. Simply save that and you are ready! :)

这篇关于Parse.com 云代码每 n 分钟调度一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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