任何时候安排/发布facebook的Cron工作 [英] Cron job for scheduling/posting facebook post any time

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

问题描述

使用案例:
即使在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工作满足所有这些要求?我的观点是我们可以在每5分钟之后运行cron工作,或者像这样的事情。可以按小时计算,但是我可以跳过一些帖子。如何确保我不会错过任何帖子。另外,我可以连续运行一个工作,但这会给服务器带来额外的负担。

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.

欢迎任何建议。

推荐答案

您可以运行Cron每分钟工作如果您只是检查要安排的帖子,则服务器不会真的是一个大问题。

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.

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

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