Skip to content

Commit 0aacba6

Browse files
committed
Update timers (lenient matching and time out)
1 parent 76d0b55 commit 0aacba6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Backend/MatchingService/rabbitmq/setup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async function setupRabbitMQ() {
4646
await channel.assertQueue(queueName, {
4747
durable: true,
4848
arguments: {
49-
'x-message-ttl': 10000, // TTL for messages in the queue
49+
'x-message-ttl': 30000, // TTL for messages in the queue
5050
'x-dead-letter-exchange': dead_letter_exchange_name // Bind to dead-letter exchange
5151
}
5252
});

Backend/MatchingService/rabbitmq/subscriber.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function matchUsers(channel, msg, userId, difficulty, category) {
9191
notifyMatch(channel, matchedUsers, category, difficulty);
9292
return true;
9393
}
94-
}, 5000); // 5-second delay
94+
}, 15000); // 15-second delay
9595
}
9696

9797
return false;
@@ -288,7 +288,7 @@ async function consumeQueue() {
288288
const timeoutId = setTimeout(async () => {
289289
const categorykey = "any." + category
290290
await rejectMessage(channel, msg, userData);
291-
}, 10000); // 10 seconds delay
291+
}, 30000); // 30 seconds delay
292292

293293
timeoutMap[userId] = timeoutId;
294294
}

0 commit comments

Comments
 (0)