Skip to content

Commit 33977b7

Browse files
committed
chore: ugly console log to check if the cache is working for sure
1 parent 4bfe6c9 commit 33977b7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

backend/src/dal/leaderboards.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,10 @@ export async function getCount(
7777
): Promise<number> {
7878
const key = `${language}_${mode}_${mode2}`;
7979
if (cachedCounts.has(key)) {
80+
console.log("lb", key, "returning cached count");
8081
return cachedCounts.get(key) as number;
8182
} else {
83+
console.log("lb", key, "getting fresh count");
8284
const count = await getCollection({
8385
language,
8486
mode,
@@ -221,6 +223,7 @@ export async function update(
221223
await db.collection(lbCollectionName).createIndex({ rank: 1 });
222224
const end2 = performance.now();
223225

226+
console.log("lb", `${language}_${mode}_${mode2}`, "deleting count cache");
224227
cachedCounts.delete(`${language}_${mode}_${mode2}`);
225228

226229
//update speedStats

0 commit comments

Comments
 (0)