forked from mirrored/github-readme-stats
fix: github rate limiter with multiple PATs
This commit is contained in:
+11
-6
@@ -5,8 +5,9 @@ async function fetchRepo(username, reponame) {
|
||||
throw new Error("Invalid username or reponame");
|
||||
}
|
||||
|
||||
const res = await request({
|
||||
query: `
|
||||
const res = await request(
|
||||
{
|
||||
query: `
|
||||
fragment RepoInfo on Repository {
|
||||
name
|
||||
stargazers {
|
||||
@@ -33,11 +34,15 @@ async function fetchRepo(username, reponame) {
|
||||
}
|
||||
}
|
||||
`,
|
||||
variables: {
|
||||
login: username,
|
||||
repo: reponame,
|
||||
variables: {
|
||||
login: username,
|
||||
repo: reponame,
|
||||
},
|
||||
},
|
||||
});
|
||||
{
|
||||
Authorization: `bearer ${process.env.PAT_1}`,
|
||||
}
|
||||
);
|
||||
|
||||
const data = res.data.data;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user