获取 GAE 上 Twitter 上所有推文和每条推文的转发量?
我的服务有 1000 名用户,每个人都发了大约 1000 次推文。所以我的服务的推文总数约为 1 000 000 条。而且这个数字一直在增加。
我的问题是,如何获取并检查每条推文的转发量,而不会让我的服务因为 GAE 的“Cron Job Exceptions”而一直崩溃?
我的问题是,如果可能的话,我需要每分钟更新所有推文的转发量?
我的服务在 Google App Engine (Java) 上运行。
I have a service with 1000 users and everyone has tweeted around 1000 times each. So the total amount of tweets from my service is around 1 000 000. And this number is increasing all the time.
My question is, how can I get and check the amount of retweets for each tweet without having my service crashing all the time because of "Cron Job Exceptions" from GAE?
My problem is that I need to update the amount of retweets for all tweets every minute if possible?
My service is running on Google App Engine (Java).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道什么是“cron 作业异常”,但我猜您是在谈论您的作业花费的时间太长?为此,您应该利用任务队列 API 来拆分您的工作并并行执行。
不过,您的 Twitter API 密钥不可能有足够的配额来每分钟更新一百万条推文,这也会给您的应用程序带来巨大的负载。相反,您最好只在有人查看推文时更新数据,并且前提是自您上次更新数据以来的时间间隔合理。
I don't know what a "cron job exception" is, except that I guess you're talking about your jobs taking too long? For that, you should utilize the Task Queue API to split up your work and execute it in parallel.
There's no way your Twitter API key is going to have enough quota for updating a million tweets every minute, though, and that would put a huge load on your app, too. Instead, you'd be better off just updating the figures when someone views their tweets, and only if it's been a reasonable interval since you last updated them.