Skip to content

Commit 9dbe4b7

Browse files
committed
chore: reduce log spam
1 parent 1477688 commit 9dbe4b7

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

backend/src/data/loops/expiringMutesLoop.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ async function broadcastExpiredMute(guildId: string, userId: string, tries = 0):
4242
}
4343

4444
function broadcastTimeoutMuteToRenew(mute: Mute, tries = 0) {
45-
console.log(`[EXPIRING MUTES LOOP] Broadcasting timeout mute to renew: ${mute.guild_id}/${mute.user_id}`);
4645
if (!hasGuildEventListener(mute.guild_id, "timeoutMuteToRenew")) {
4746
// If there are no listeners registered for the server yet, try again in a bit
4847
if (tries < MAX_TRIES_PER_SERVER) {
@@ -53,6 +52,7 @@ function broadcastTimeoutMuteToRenew(mute: Mute, tries = 0) {
5352
}
5453
return;
5554
}
55+
console.log(`[EXPIRING MUTES LOOP] Broadcasting timeout mute to renew: ${mute.guild_id}/${mute.user_id}`);
5656
emitGuildEvent(mute.guild_id, "timeoutMuteToRenew", [mute]);
5757
}
5858

backend/src/data/loops/expiringTempbansLoop.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ function tempbanToKey(tempban: Tempban) {
1717
}
1818

1919
function broadcastExpiredTempban(tempban: Tempban, tries = 0) {
20-
console.log(`[EXPIRING TEMPBANS LOOP] Broadcasting expired tempban: ${tempban.guild_id}/${tempban.user_id}`);
2120
if (!hasGuildEventListener(tempban.guild_id, "expiredTempban")) {
2221
// If there are no listeners registered for the server yet, try again in a bit
2322
if (tries < MAX_TRIES_PER_SERVER) {
@@ -28,6 +27,7 @@ function broadcastExpiredTempban(tempban: Tempban, tries = 0) {
2827
}
2928
return;
3029
}
30+
console.log(`[EXPIRING TEMPBANS LOOP] Broadcasting expired tempban: ${tempban.guild_id}/${tempban.user_id}`);
3131
emitGuildEvent(tempban.guild_id, "expiredTempban", [tempban]);
3232
}
3333

backend/src/data/loops/upcomingScheduledPostsLoop.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,21 @@ export function registerUpcomingScheduledPost(post: ScheduledPost) {
5353
return;
5454
}
5555

56-
console.log("[SCHEDULED POSTS LOOP] Registering new upcoming scheduled post");
5756
const remaining = Math.max(0, moment.utc(post.post_at).diff(moment.utc()));
5857
if (remaining > LOOP_INTERVAL) {
5958
return;
6059
}
6160

61+
console.log("[SCHEDULED POSTS LOOP] Registering new upcoming scheduled post");
6262
timeouts.set(
6363
post.id,
6464
setTimeout(() => broadcastScheduledPost(post), remaining),
6565
);
6666
}
6767

6868
export function clearUpcomingScheduledPost(post: ScheduledPost) {
69-
console.log("[SCHEDULED POSTS LOOP] Clearing upcoming scheduled post");
7069
if (timeouts.has(post.id)) {
70+
console.log("[SCHEDULED POSTS LOOP] Clearing upcoming scheduled post");
7171
clearTimeout(timeouts.get(post.id)!);
7272
}
7373
}

0 commit comments

Comments
 (0)