Skip to content

Commit

Permalink
another github token
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyBurger committed Dec 13, 2023
1 parent 5159157 commit 8d94184
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ DB_USER=
DISCORD_CHANNEL=
DISCORD_TOKEN=

# 4 GitHub tokens for load balancing API requests.
# 6 GitHub tokens for load balancing API requests.
# If you have fewer, enter the same multiple times.
GITHUB_TOKEN_1=
GITHUB_TOKEN_2=
GITHUB_TOKEN_3=
GITHUB_TOKEN_4=
GITHUB_TOKEN_5=
GITHUB_TOKEN_6=

# The domain of the website
VITE_HOST=http://localhost:8080
Expand Down
1 change: 1 addition & 0 deletions src/helpers/domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const parseBackendCredentials = () => {
GITHUB_TOKEN_3: z.string(),
GITHUB_TOKEN_4: z.string(),
GITHUB_TOKEN_5: z.string(),
GITHUB_TOKEN_6: z.string(),
SENTRY_DSN: z.string(),
})
.parse(process.env);
Expand Down
6 changes: 5 additions & 1 deletion src/server/github-token.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { backendCredentials } from "../helpers/domain.js";

const TOKENS = 5;
const TOKENS = 6;

let i = 0;

Expand All @@ -27,5 +27,9 @@ export const getRandomGithubToken = (): string => {
return backendCredentials().GITHUB_TOKEN_5;
}

if (index === 6) {
return backendCredentials().GITHUB_TOKEN_6;
}

throw new Error("GitHub token not found");
};

0 comments on commit 8d94184

Please sign in to comment.