debug++
This commit is contained in:
parent
ef53ee64c6
commit
570e5cc491
3 changed files with 20 additions and 0 deletions
11
backend/package-lock.json
generated
11
backend/package-lock.json
generated
|
@ -9,6 +9,7 @@
|
|||
"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",
|
||||
|
@ -1074,6 +1075,11 @@
|
|||
"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",
|
||||
|
@ -6783,6 +6789,11 @@
|
|||
"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",
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
},
|
||||
"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",
|
||||
|
|
|
@ -29,6 +29,7 @@ import { runUpcomingScheduledPostsLoop } from "./data/loops/upcomingScheduledPos
|
|||
import { runExpiringTempbansLoop } from "./data/loops/expiringTempbansLoop";
|
||||
import { runExpiringVCAlertsLoop } from "./data/loops/expiringVCAlertsLoop";
|
||||
import { runExpiredArchiveDeletionLoop } from "./data/loops/expiredArchiveDeletionLoop";
|
||||
import blockedAt from "blocked-at";
|
||||
|
||||
if (!process.env.KEY) {
|
||||
// tslint:disable-next-line:no-console
|
||||
|
@ -336,6 +337,13 @@ connect().then(async () => {
|
|||
logRateLimit(data);
|
||||
});
|
||||
|
||||
blockedAt(
|
||||
(time, stack) => {
|
||||
console.error(`Blocked for ${time}ms, operation started here:`, stack);
|
||||
},
|
||||
{ threshold: 750 },
|
||||
);
|
||||
|
||||
bot.on("loadingFinished", async () => {
|
||||
runExpiringMutesLoop();
|
||||
await sleep(10 * SECONDS);
|
||||
|
|
Loading…
Add table
Reference in a new issue