Skip to content

Commit e0e3feb

Browse files
committed
Continue trying to catch hanging
1 parent 8f75690 commit e0e3feb

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

events/Interaction/interactionCreate.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import * as discordTranscripts from 'discord-html-transcripts';
1515
export async function run(client, interaction) {
1616
interaction.settings = client.getSettings(interaction.guild);
1717
const level = await client.permlevel(interaction);
18+
console.log('[DEBUG] interactionCreate fired:', interaction.type);
1819

1920
// Check for global blacklist
2021
const connection = await interaction.client.db.getConnection();

events/Message/messageCreate.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ export async function run(client, message) {
209209
await handleEconomyEvent(client, message);
210210
return;
211211
}
212+
console.log('[DEBUG] messageCreate fired:', message.content);
212213

213214
// Command handling
214215
const args = message.content.slice(prefix.length).trim().split(/\s+/g);

index.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,17 +1125,10 @@ process.on('unhandledRejection', (err) => {
11251125
return client.logger.error(`Unhandled Rejection: ${err}`);
11261126
});
11271127

1128-
const { Status } = require('discord.js');
1129-
1130-
setInterval(() => {
1131-
const status = client.ws.status;
1132-
// If using discord.js v14+, status is a number enum. Map it to human words:
1133-
const statusText = Object.entries(Status).find(([key, val]) => val === status)?.[0] || status;
1134-
client.logger.log(`[GATEWAY STATUS]: ${statusText} (${status})`);
1135-
}, 30_000);
1136-
11371128
const blocked = require('blocked-at');
11381129

11391130
blocked((time, stack) => {
1140-
console.log(`Blocked for ${time}ms, operation started here:`, stack);
1131+
if (time > 100) {
1132+
console.warn(`Event loop blocked for ${time}ms, operation started here:`, stack);
1133+
}
11411134
});

0 commit comments

Comments
 (0)