Skip to content

Commit

Permalink
add debug logs for popping pairs aka idk why this shit broke asjkdgba…
Browse files Browse the repository at this point in the history
…dlfkjg
  • Loading branch information
VKong6019 committed Feb 19, 2023
1 parent 3b30ad6 commit 5460829
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions database/poolDataManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ export class PoolDataManager {
async popPair(user: string, alreadyPairedList: string[]): Promise<Map<string, string>> {
const userPool = await this.getPoolForUser(user);
const unusedUserPool = userPool.filter(unusedPair => !this.containsAny(alreadyPairedList, unusedPair));

console.log(`DEBUG: popping for this user ${user} with an alreadyPairedList of ${alreadyPairedList}`);
console.log(`DEBUG: retrieved an unusedUserPool for pairing ${unusedUserPool}`);

const randomPair = unusedUserPool[Math.floor(Math.random() * unusedUserPool.length)];
await this.deletePair(new Map(Object.entries(randomPair)));

Expand Down

0 comments on commit 5460829

Please sign in to comment.