Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to deal with today's news? #28

Closed
lord63 opened this issue Nov 4, 2015 · 1 comment
Closed

How to deal with today's news? #28

lord63 opened this issue Nov 4, 2015 · 1 comment

Comments

@lord63
Copy link
Owner

lord63 commented Nov 4, 2015

目前是直接向日报请求,然后加个缓存。考虑以后是否存数据库,如果真这样,views 和 fetch 脚本都是要改的。

@lord63
Copy link
Owner Author

lord63 commented Nov 11, 2015

先说明一下现在的状况:

  • text UI, image UI, pages UI, three-columns UI , feeds 的当天的内容都是直接向日报发请求,然后加个缓存。three-colums UI 还会通过 AJAX 请求你选择的文章的内容。
  • 各个 UI 当天之前的日报都是直接从数据库中取的。
  • fetch_data.py 设置个 cron 定时任务,每天取抓取上一天的内容。

总结一下就是,当天的日报是直接向日报发请求的,当天之前的是从数据库取。这样的做的原因,可能是由于早先时候的设计比较简单,是没有数据库使用的。但直接发请求的服务稳定性不好,日报 API 跪我这边就跪了,而且响应时间其实有点长。

现在的想法是,数据抓取方面的事务都交由 fetch_data.py 处理,而视图方面则统一从数据库里取。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant