Cron任何时间安排/张贴Facebook的工作 [英] Cron job for scheduling/posting facebook post any time

查看:312
本文介绍了Cron任何时间安排/张贴Facebook的工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用例:
用户可以在6个月后随时在Facebook上发布。在后端,我将存储用户内容的帖子,并将运行cron作业以通过访问令牌发布。这样我可以在用户/页面/组发布任何问题。但是似乎cron部分对我不是很清楚。考虑以下情况:

Use Case: User can post anytime on Facebook even after 6 months. In the backend, I'll be storing the posts with user content and will be running a cron job to make post through access token. This way I can post on user/page/group withoout any issues. But it seems cron part is not very clear to me. Consider following scenario:


用户A想在星期四下午7点安排他的职位。用户B想要
在星期四下午7:05安排他的职位。用户C想在周四下午7:03安排他的职位
。用户D想要安排他的职位在
星期四下午8时。用户E想在星期四下午7:10在
安排他的职位。和更多.....

User A wants to schedule his post at 7 pm on Thursday. User B wants to schedule his post at 7:05 pm on Thursday. User C wants to schedule his post at 7:03 pm on Thursday. User D wants to schedule his post at 8 pm on Thursday. User E wants to schedule his post at 7:10 pm on Thursday. and many more.....

现在,如何放置cron作业以满足所有这些要求?我的观点是,我们可以运行cron工作每5分钟或类似的东西。可以按小时基础,但这种方式我可以跳过一些职位。我如何确保我不会错过任何职位。

Now, How can I put a cron job to meet all these requirements? My point is we can run cron job after every 5 mins or something like that..may be on hourly basis but this way I may skip some posts. How can I make sure I don't miss any of the post. Also, I can run a job in background continuously but that will put extra load on the server.

我在下面找到了线程,但仍然无法将我的问题与此相关联。此外,我得到这个解决方案作为我以前的问题的一部分,可以找到这里

I found following thread but still not able to correlate my problem to this. Also, I got this solution as a part of my previous question which can be found here.

欢迎任何建议。

推荐答案

工作每分钟。如果你只是检查的职位安排,它不会真的是一个大问题的服务器。

You can run a Cron Job every minute. If you just check for posts to schedule, it will not really be a big problem for the server.

这篇关于Cron任何时间安排/张贴Facebook的工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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