feat: remove blocked-at usage

The package never really worked with Zep, causing the
entire bot to freeze instead.
This commit is contained in:
Dragory 2021-11-02 22:14:41 +02:00
parent 3f0c1496dc
commit 901a723080
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
3 changed files with 0 additions and 45 deletions

View file

@ -9,7 +9,6 @@
"version": "0.0.1",
"dependencies": {
"@silvia-odwyer/photon-node": "^0.3.1",
"blocked-at": "^1.2.0",
"bufferutil": "^4.0.3",
"cors": "^2.8.5",
"cross-env": "^5.2.0",
@ -1095,11 +1094,6 @@
"file-uri-to-path": "1.0.0"
}
},
"node_modules/blocked-at": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/blocked-at/-/blocked-at-1.2.0.tgz",
"integrity": "sha512-Ba9yhK4KcFrgqEPgsU0qVGiMimf+VrD9QJo9pgwjg4yl0GXwgOJS8IRx2rPepQjalrmUdGTqX47bSuJLUMLX7w=="
},
"node_modules/blueimp-md5": {
"version": "2.16.0",
"resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.16.0.tgz",
@ -6940,11 +6934,6 @@
"file-uri-to-path": "1.0.0"
}
},
"blocked-at": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/blocked-at/-/blocked-at-1.2.0.tgz",
"integrity": "sha512-Ba9yhK4KcFrgqEPgsU0qVGiMimf+VrD9QJo9pgwjg4yl0GXwgOJS8IRx2rPepQjalrmUdGTqX47bSuJLUMLX7w=="
},
"blueimp-md5": {
"version": "2.16.0",
"resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.16.0.tgz",

View file

@ -24,7 +24,6 @@
},
"dependencies": {
"@silvia-odwyer/photon-node": "^0.3.1",
"blocked-at": "^1.2.0",
"bufferutil": "^4.0.3",
"cors": "^2.8.5",
"cross-env": "^5.2.0",

View file

@ -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`);
},
});