Skip to content

Commit

Permalink
fix texts by configuring guest pool size
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeke Nierenberg committed Jul 2, 2022
1 parent 0bd21c5 commit 63b1101
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions integration-tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ services:
REDIS_URL: redis://redis:6379/0
ROARR_LOG: "false"
PORT: 3001
TARGET_GUEST_POOL_SIZE: 0
RUNNER_URL: http://code_runner:3002
JWT_SECRET: asdf
SECRET_ACCESS_KEY_KEY: aaaa
Expand Down
3 changes: 2 additions & 1 deletion server/.env
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ SECRETS_URL=http://localhost:3003
CLIENT_URL=http://localhost:3000
SMTP_USER=
SMTP_PASSWORD=
SMTP_HOST=
SMTP_HOST=
TARGET_GUEST_POOL_SIZE=2000
3 changes: 1 addition & 2 deletions server/src/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,14 @@ export async function initiateGuestUserFallback() {
export async function initiateGuestUser() {
process.nextTick(async () => {
const count = await countGuestUserPool();
if (count < 2000) {
if (count < Number(process.env.TARGET_GUEST_POOL_SIZE!)) {
await enqueue({
name: "bulk-create-guest-users",
input: {},
});
}
});
const userId = await pullFromGuestPool();
console.log("userid from pool", userId);
if (!userId) {
return initiateGuestUserFallback();
}
Expand Down

0 comments on commit 63b1101

Please sign in to comment.