Skip to content

Commit c7858d5

Browse files
committed
clear the bump cache
1 parent 4f8b9b2 commit c7858d5

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/modules/core/bump.listener.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { logger } from "../../logging.js";
1313
import { config } from "../../Config.js";
1414
import { Bump } from "../../store/models/Bump.js";
1515
import {
16+
clearBumpsCache,
1617
extractStreaks,
1718
getAllBumps,
1819
getBumpStreak,
@@ -86,6 +87,10 @@ export async function handleBumpStreak(
8687
message.channel.send(
8788
`⚡ ${fakeMention(interactionOld.user)} bumped in just **${timeSinceLastBump / 1000}s**!`,
8889
);
90+
} else {
91+
logger.debug(
92+
`Time since last bump: ${timeSinceLastBump / 1000}s, not fast enough for a lightning bolt`,
93+
);
8994
}
9095
} else {
9196
logger.debug("No previous bump notification time");
@@ -128,6 +133,7 @@ export async function handleBump(
128133
},
129134
) {
130135
lastBumpTime = new Date();
136+
131137
scheduleBumpReminder(client);
132138

133139
await handleBumpStreak(bumper, interactionOld, message, client);
@@ -162,6 +168,7 @@ export const BumpListener: EventListener = {
162168
logger.info(
163169
`User ${interactionOld.user.id} bumped! Total bumps: ${await ddUser.countBumps()}`,
164170
);
171+
clearBumpsCache();
165172
await ddUser.save();
166173
await handleBump(client, ddUser, interactionOld, message);
167174
},

0 commit comments

Comments
 (0)