Skip to content

Commit b17d672

Browse files
committed
Temporarily removing priority queues
This might fix things, as they seem to be causing some errors
1 parent c3ad4a5 commit b17d672

File tree

3 files changed

+31
-29
lines changed

3 files changed

+31
-29
lines changed

src/events/interactionCreate.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import {
3737
getQueueSettings,
3838
getStake,
3939
getStakeByName,
40-
getUserPriorityQueueId,
40+
// getUserPriorityQueueId,
4141
getUserQueues,
4242
setMatchStakeVoteTeam,
4343
setPickedMatchStake,
@@ -434,9 +434,9 @@ export default {
434434

435435
if (interaction.customId === 'check-queued') {
436436
const userQueueList = await getUserQueues(interaction.user.id)
437-
const priorityQueueId = await getUserPriorityQueueId(
438-
interaction.user.id,
439-
)
437+
// const priorityQueueId = await getUserPriorityQueueId(
438+
// interaction.user.id,
439+
// )
440440

441441
if (userQueueList.length > 0) {
442442
const timeSpent = await timeSpentInQueue(
@@ -447,7 +447,7 @@ export default {
447447
content:
448448
`
449449
You are in queue for **${userQueueList.map((queue) => `${queue.queue_name}`).join(', ')}**!` +
450-
`${priorityQueueId ? `\nYour priority queue is **${(await getQueueSettings(priorityQueueId, ['queue_name'])).queue_name}**!` : ``}` +
450+
// `${priorityQueueId ? `\nYour priority queue is **${(await getQueueSettings(priorityQueueId, ['queue_name'])).queue_name}**!` : ``}` +
451451
`\nJoined queue ${timeSpent}.`,
452452
flags: MessageFlags.Ephemeral,
453453
})

src/utils/cronJobs.ts

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export async function incrementEloCronJobAllQueues() {
9292
if (elo === null) continue
9393
const userTimeSpent = await timeSpentInQueue(userId, queue.id)
9494
if (userTimeSpent === null) continue
95-
const userPriorityQueueId = await getUserPriorityQueueId(userId)
95+
const userPriorityQueueId = null // Temporary
9696

9797
const currentRange = await getCurrentEloRangeForUser(userId, queue.id)
9898
const newRange = (currentRange ?? start) + increment
@@ -118,28 +118,29 @@ export async function incrementEloCronJobAllQueues() {
118118
let inRange =
119119
diff < candidates[i].range && diff < candidates[j].range
120120

121-
// Time-in-queue check
122-
const anyTooRecent = [candidates[i], candidates[j]].some(
123-
(candidate) => {
124-
if (
125-
candidate.queueId === candidate.priorityQueueId ||
126-
candidate.priorityQueueId === null
127-
)
128-
return false
129-
130-
const match = candidate.timeInQueue?.match(
131-
/<t:(\d+)(?::[a-zA-Z])?>/,
132-
)
133-
if (!match) return false
134-
135-
const tsMs = parseInt(match[1], 10) * 1000
136-
const diffMinutes = (Date.now() - tsMs) / 60000
137-
138-
return diffMinutes < 3
139-
},
140-
)
141-
142-
inRange = inRange && !anyTooRecent
121+
// Temporarily removing this until its fixed
122+
// // Time-in-queue check
123+
// const anyTooRecent = [candidates[i], candidates[j]].some(
124+
// (candidate) => {
125+
// if (
126+
// candidate.queueId === candidate.priorityQueueId ||
127+
// candidate.priorityQueueId === null
128+
// )
129+
// return false
130+
//
131+
// const match = candidate.timeInQueue?.match(
132+
// /<t:(\d+)(?::[a-zA-Z])?>/,
133+
// )
134+
// if (!match) return false
135+
//
136+
// const tsMs = parseInt(match[1], 10) * 1000
137+
// const diffMinutes = (Date.now() - tsMs) / 60000
138+
//
139+
// return diffMinutes < 3
140+
// },
141+
// )
142+
//
143+
// inRange = inRange && !anyTooRecent
143144

144145
if (inRange && diff < minDiff) {
145146
minDiff = diff

src/utils/queueHelpers.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ export async function updateQueueMessage(): Promise<Message | undefined> {
103103
.setCustomId(`set-priority-queue`)
104104
.setLabel('Set Priority Queue')
105105
.setStyle(ButtonStyle.Primary)
106-
.setDisabled(options.length < 2)
106+
.setDisabled(true)
107+
// .setDisabled(options.length < 2)
107108

108109
const buttonRow = new ActionRowBuilder<ButtonBuilder>().addComponents(
109110
leaveQueue,

0 commit comments

Comments
 (0)