Habilitação do garbage_collection

pull/21/head
adriano 2023-01-07 16:35:25 -03:00
parent 8059781c92
commit aa36aedd43
2 changed files with 7 additions and 7 deletions

View File

@ -6,7 +6,7 @@
"scripts": {
"build": "tsc",
"watch": "tsc -w",
"start": "nodemon dist/server.js",
"start": "nodemon --expose-gc dist/server.js",
"dev:server": "ts-node-dev --respawn --transpile-only --ignore node_modules src/server.ts",
"pretest": "NODE_ENV=test sequelize db:migrate && NODE_ENV=test sequelize db:seed:all",
"test": "NODE_ENV=test jest",

View File

@ -9,12 +9,12 @@ const server = app.listen(process.env.PORT, () => {
});
// if (global.gc) {
// console.log(">> Starting Garbage Collector...");
// global.gc();
// } else {
// console.warn('No GC hook! Start your program as `node --expose-gc file.js`.');
// }
if (global.gc) {
console.log(">> Starting Garbage Collector...");
global.gc();
} else {
console.warn('No GC hook! Start your program as `node --expose-gc file.js`.');
}
initIO(server);
StartAllWhatsAppsSessions();