Cron job for scheduling/posting facebook post any time

狂风中的少年 提交于 2019-12-25 06:56:03

问题


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:

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.....

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.

Any suggestions are welcome.


回答1:


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.



来源:https://stackoverflow.com/questions/32189963/cron-job-for-scheduling-posting-facebook-post-any-time

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