Skip to content

Commit

Permalink
fix: remove why-is-node-running from prod
Browse files Browse the repository at this point in the history
Still sticking around for development - it works well, but I suspect
it's causing some nasty long-term memory leaks, since all my projects
using it are reaching 1.5 GB memory after ~2 months.
  • Loading branch information
Lemmmy committed Sep 5, 2024
1 parent 0bff95b commit c6f417f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "krist",
"version": "3.5.2",
"version": "3.5.3",
"description": "The new Krist node written in TypeScript.",
"type": "module",
"scripts": {
"build": "tsc -p tsconfig.json",
"start": "node dist/src/index.js",
"dev": "tsx src/index.ts",
"dev": "tsx --import why-is-node-running/include.js src/index.ts",
"docs": "apidoc -v -t apidoc-template -i src -o static/docs",
"test": "cross-env TS_NODE_PROJECT='./tsconfig.test.json' NODE_ENV=test mocha 'test/**/*.test.ts'",
"test:coverage": "nyc pnpm run test",
Expand Down
6 changes: 0 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import "dotenv/config";

import chalkT from "chalk-template";
import whyIsNodeRunning from "why-is-node-running";
import packageJson from "../package.json" with { type: "json" };
import { initDatabase, shutdownDb } from "./database/index.js";
import { initRedis, shutdownRedis } from "./database/redis.js";
Expand Down Expand Up @@ -60,11 +59,6 @@ function shutdown() {
shutdownAuthLogCleanup();
shutdownWebSocketIpc();
})().catch(console.error);

setTimeout(() => {
console.log("Still shutting down?");
whyIsNodeRunning();
}, 8000).unref();
}

process.on("SIGINT", shutdown);
Expand Down

0 comments on commit c6f417f

Please sign in to comment.