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
11
backend/package-lock.json
generated
11
backend/package-lock.json
generated
|
@ -9,7 +9,6 @@
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@silvia-odwyer/photon-node": "^0.3.1",
|
"@silvia-odwyer/photon-node": "^0.3.1",
|
||||||
"blocked-at": "^1.2.0",
|
|
||||||
"bufferutil": "^4.0.3",
|
"bufferutil": "^4.0.3",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"cross-env": "^5.2.0",
|
"cross-env": "^5.2.0",
|
||||||
|
@ -1095,11 +1094,6 @@
|
||||||
"file-uri-to-path": "1.0.0"
|
"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": {
|
"node_modules/blueimp-md5": {
|
||||||
"version": "2.16.0",
|
"version": "2.16.0",
|
||||||
"resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.16.0.tgz",
|
"resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.16.0.tgz",
|
||||||
|
@ -6940,11 +6934,6 @@
|
||||||
"file-uri-to-path": "1.0.0"
|
"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": {
|
"blueimp-md5": {
|
||||||
"version": "2.16.0",
|
"version": "2.16.0",
|
||||||
"resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.16.0.tgz",
|
"resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.16.0.tgz",
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@silvia-odwyer/photon-node": "^0.3.1",
|
"@silvia-odwyer/photon-node": "^0.3.1",
|
||||||
"blocked-at": "^1.2.0",
|
|
||||||
"bufferutil": "^4.0.3",
|
"bufferutil": "^4.0.3",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"cross-env": "^5.2.0",
|
"cross-env": "^5.2.0",
|
||||||
|
|
|
@ -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
Reference in a new issue