diff --git a/README.md b/README.md index c6fbf0b38..7ff43946a 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ This repository provides scripts to update the database for the [AWS](https://github.com/ghuser-io/ghuser.io/blob/master/aws). The scripts expect it at `~/data` and this can be overridden by setting the `GHUSER_DBDIR` environment variable. -The [fetchBot](fetchBot/) calls these scripts. It runs daily on an +The [fetchBot](fetchBot/) calls these scripts. It runs every few days on an [EC2 instance](https://github.com/ghuser-io/ghuser.io/blob/master/aws/ec2). ## Table of Contents @@ -159,7 +159,7 @@ e.g. * [`contribs/brillout.json`](https://s3.amazonaws.com/ghuser/data/contribs/brillout.json) * [`meta.json`](https://s3.amazonaws.com/ghuser/data/meta.json) -A daily backup named `YYYY-MM-DD.tar.gz` containing all the JSON files is also available, e.g. +Every few days a backup named `YYYY-MM-DD.tar.gz` containing all the JSON files is created, e.g. [`2018-10-07.tar.gz`](https://s3.amazonaws.com/ghuser/backups/2018-10-07.tar.gz). ## Contributors diff --git a/fetchBot/bot.sh b/fetchBot/bot.sh index 31b1ca3f4..a7192fb0e 100755 --- a/fetchBot/bot.sh +++ b/fetchBot/bot.sh @@ -82,7 +82,7 @@ function waitForJob { break fi - if [ "$(($lastRun + 10 * 60 * 60))" -le "$(now)" ]; then + if [ "$(($lastRun + 48 * 60 * 60))" -le "$(now)" ]; then break fi sleep 60 diff --git a/fetchRepos.js b/fetchRepos.js index 10f74d6a5..7b99681ce 100755 --- a/fetchRepos.js +++ b/fetchRepos.js @@ -134,7 +134,7 @@ optional arguments: const repo = new DbFile(repoPaths(repoFullName).repo); const now = new Date; - const maxAgeHours = firsttime && (24 * 365) || 12; + const maxAgeHours = firsttime && (24 * 365) || 72; if (repo.fetching_since || repo.fetched_at && now - Date.parse(repo.fetched_at) < maxAgeHours * 60 * 60 * 1000) { spinner.succeed(`${repoFullName} is still fresh`); diff --git a/fetchUserDetailsAndContribs.js b/fetchUserDetailsAndContribs.js index 311cd6e89..f831109ed 100755 --- a/fetchUserDetailsAndContribs.js +++ b/fetchUserDetailsAndContribs.js @@ -98,7 +98,7 @@ optional arguments: { const now = new Date; - const maxAgeHours = 12; + const maxAgeHours = 72; if (userFile.contribs && userFile.contribs.fetched_at && now - Date.parse(userFile.contribs.fetched_at) < maxAgeHours * 60 * 60 * 1000) { console.log(`${userFile.login} is still fresh, skipping...`);