feat: remove blocked-at usage
The package never really worked with Zep, causing the entire bot to freeze instead.
This commit is contained in:
parent
3f0c1496dc
commit
901a723080
3 changed files with 0 additions and 45 deletions
|
@ -1,33 +0,0 @@
|
|||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { botControlCmd } from "../types";
|
||||
import blockedAt from "blocked-at";
|
||||
|
||||
let stop;
|
||||
|
||||
export const ToggleBlockDetectionCmd = botControlCmd({
|
||||
trigger: ["toggle_block_detection"],
|
||||
permission: "can_performance",
|
||||
|
||||
signature: {
|
||||
threshold: ct.number({ required: false }),
|
||||
},
|
||||
|
||||
async run({ pluginData, message: msg, args }) {
|
||||
if (stop) {
|
||||
stop();
|
||||
stop = null;
|
||||
msg.channel.send("Disabled block detection");
|
||||
return;
|
||||
}
|
||||
|
||||
const threshold = args.threshold || 1000;
|
||||
const result = blockedAt(
|
||||
(time, stack) => {
|
||||
console.error(`Blocked for ${time}ms, operation started here:`, stack);
|
||||
},
|
||||
{ threshold },
|
||||
);
|
||||
stop = result.stop;
|
||||
msg.channel.send(`Block detection enabled with ${threshold}ms threshold`);
|
||||
},
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue