Skip to content

Commit 709cece

Browse files
committed
Speedy quick fix for current_elo_range
1 parent 9273222 commit 709cece

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/utils/queryDB.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,8 @@ export async function removeUserFromQueue(
865865
[userId, queueId],
866866
)
867867

868+
await resetCurrentEloRangeForUser(userId, queueId)
869+
868870
return response.rowCount !== 0
869871
}
870872

@@ -1374,6 +1376,17 @@ export async function updateCurrentEloRangeForUser(
13741376
)
13751377
}
13761378

1379+
export async function resetCurrentEloRangeForUser(
1380+
userId: string,
1381+
queueId: number,
1382+
): Promise<void> {
1383+
const queueSettings = await getQueueSettings(queueId)
1384+
await pool.query(
1385+
`UPDATE queue_users SET current_elo_range = $3 WHERE user_id = $1 AND queue_id = $2`,
1386+
[userId, queueId, queueSettings.elo_search_start],
1387+
)
1388+
}
1389+
13771390
// get the users in a specific match
13781391
export async function getUsersInMatch(matchId: number): Promise<string[]> {
13791392
const response = await pool.query(

0 commit comments

Comments
 (0)