Fresh golf news every hour, in pages of 20
Why it matters: Players get fresh golf headlines on the site through the day, and can page back through older stories.
The golf news page now brings in fresh golf news articles every hour, on its own. Each story shows its headline, a short snippet and the outlet it came from, with a link to the full article. Stories already on the site aren’t added twice.
The news page now shows 20 stories at a time. Newer and Older links move between pages and keep any filters you’ve chosen, and the featured story appears only on the first page.
Under the hood: New articles are brought in by a scheduled background job that runs every hour. It accepts only well-formed news feeds of a reasonable size, over a secure connection. The news page now reads its cached list once per visit, so an update that refreshes the list in the middle of a visit no longer breaks the page.
Commits (1)
-
035e770News import every hour (was every 6 hours)
Files Changed (7)
app/controllers/golf/posts_controller.rb | 2 +- app/jobs/news_import_job.rb | 2 +- app/services/news_snippet_ingestion_service.rb | 8 ++++---- config/recurring.yml | 2 +- docs/background_jobs.md | 7 ++++--- test/controllers/golf/posts_pagination_test.rb | 2 +- test/jobs/news_import_job_test.rb | 6 +++--- 7 files changed, 15 insertions(+), 14 deletions(-)