Skip to content

Commit

Permalink
Refresh profiles less often // ghuser-io/ghuser.io#190
Browse files Browse the repository at this point in the history
  • Loading branch information
lourot committed Jul 10, 2019
1 parent 97da894 commit f5181a5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion fetchBot/bot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion fetchRepos.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
Expand Down
2 changes: 1 addition & 1 deletion fetchUserDetailsAndContribs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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...`);
Expand Down

0 comments on commit f5181a5

Please sign in to comment.