Page MenuHomeSoftware Heritage

make website counters resilient to webapp downtime
Closed, MigratedEdits Locked

Description

It would be nice if the counters didn't reset to 0 when the webapp is down.

Possible implementation: cron job on the webapp machine that periodically wget the json file at https://archive.softwareheritage.org/api/1/stat/counters/ ; change the website js to load that file instead of ajax calling into the webapp.
As a side-effect of this specific implementation we will not need to use JSONP any more for content counters.

Revisions and Commits

Event Timeline

zack claimed this task.
zack raised the priority of this task from to Normal.
zack updated the task description. (Show Details)
zack added a project: Website.
zack closed this task as Resolved by committing Restricted Diffusion Commit.Jan 14 2016, 5:35 PM
zack added a commit: Restricted Diffusion Commit.

it's not visible in the commit, but I've also just added the following (horrible) anacrontab line to our gandi simple-paas instance

4@hourly 0 statcache wget -qO /srv/data/web/vhosts/www.softwareheritage.org/htdocs/stat-counters.js.new https://archive.softwareheritage.org/api/1/stat/counters/\?callback=swh_load_counters && mv /srv/data/web/vhosts/www.softwareheritage.org/htdocs/stat-counters.js.new /srv/data/web/vhosts/www.softwareheritage.org/htdocs/stat-counters.js

to maintain the cached copy of stat-counters up to date (every 4 hours)

olasd changed the visibility from "All Users" to "Public (No Login Required)".May 13 2016, 5:07 PM