Skip to content

Commit

Permalink
Forgot to update this reference
Browse files Browse the repository at this point in the history
  • Loading branch information
Naviary2 committed Jan 9, 2025
1 parent e3a950f commit bb30719
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/server/api/GitHub.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ let contributors = (() => {
if (fileIfExists) return JSON.parse(fileIfExists);
return [];
})();
// console.log(contributors);
console.log(contributors);

/** The interval, in milliseconds, to use GitHub's API to refresh the contributor list. */
const intervalToRefreshContributorsMillis = 1000 * 60 * 60 * 3; // 3 hours
// const intervalToRefreshContributorsMillis = 1000 * 20; // 20s for dev testing

/** The id of the interval to update contributors. Can be used to cancel it if the API token isn't specified. */
const intervalId = setInterval(refreshGitHubContributorsList, intervalToRefreshContributorsMillis);
// refreshGitHubContributorsList(); // Initial refreshal for dev testing
refreshGitHubContributorsList(); // Initial refreshal for dev testing

if (process.env.GITHUB_API_KEY === undefined || process.env.GITHUB_REPO === undefined) throw new Error('.env file is missing GITHUB_API_KEY or GITHUB_REPO, please regenerate the file or add the lines manually.');

Expand Down Expand Up @@ -107,7 +107,7 @@ function refreshGitHubContributorsList() {

if (currentContributors.length > 0) {
contributors = currentContributors;
await writeFile(join(dirname, PATH_TO_CONTRIBUTORS_FILE), JSON.stringify(contributors, null, 2));
await writeFile(join(__dirname, PATH_TO_CONTRIBUTORS_FILE), JSON.stringify(contributors, null, 2));
console.log("Contributors updated!");
}
} catch {
Expand Down

0 comments on commit bb30719

Please sign in to comment.