Skip to content

Commit e6f2e25

Browse files
committed
bandaid for rate limits
1 parent e4a0b06 commit e6f2e25

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/utils/queueHelpers.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ let lastMatchCreationTime = 0
4242

4343
// Updates or sends a new queue message for the specified text channel
4444
export async function updateQueueMessage(): Promise<Message | undefined> {
45+
// for now limiting edits to 10% - todo: more robust fix
46+
if (Math.random() > 0.1) return
47+
4548
const response = await pool.query(
4649
'SELECT queue_channel_id, queue_message_id FROM settings',
4750
)
@@ -59,7 +62,13 @@ export async function updateQueueMessage(): Promise<Message | undefined> {
5962
if (queueListResponse.rowCount == 0) return
6063
let queueList: Queues[] = queueListResponse.rows
6164
queueList = queueList.filter((queue) => !queue.locked)
62-
const QUEUE_ORDER = ['Standard Ranked', 'Legacy Ranked', 'Smallworld', 'Sandbox', 'Casual']
65+
const QUEUE_ORDER = [
66+
'Standard Ranked',
67+
'Legacy Ranked',
68+
'Smallworld',
69+
'Sandbox',
70+
'Casual',
71+
]
6372
queueList.sort((a, b) => {
6473
const ai = QUEUE_ORDER.indexOf(a.queue_name)
6574
const bi = QUEUE_ORDER.indexOf(b.queue_name)

0 commit comments

Comments
 (0)