From 8c05cfe6a2f55c749a6b1e3a6d7285d5801169a5 Mon Sep 17 00:00:00 2001 From: Alex Kocharin Date: Sun, 29 Dec 2013 04:52:23 +0400 Subject: [PATCH] require heapdump if present on the system --- lib/cli.js | 6 ++++++ package.yaml | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/cli.js b/lib/cli.js index 408678c7b..5a1a45b8b 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -4,6 +4,12 @@ if (process.getuid() === 0) { global.console.error("Sinopia doesn't need superuser privileges. Don't run it under root.") } +try { + // for debugging memory leaks + // totally optional + require('heapdump') +} catch(err){} + var logger = require('./logger') logger.setup() // default setup diff --git a/package.yaml b/package.yaml index 33d1faac4..efb8c2a5e 100644 --- a/package.yaml +++ b/package.yaml @@ -7,7 +7,7 @@ description: Private npm repository server author: name: Alex Kocharin email: alex@kocharin.ru - + repository: type: git url: git://github.com/rlidwka/sinopia @@ -37,6 +37,10 @@ devDependencies: eslint: '*' #eslint-stylish: '*' + # for debugging memory leaks, it'll be require()'d if + # installed, but I don't want it to be installed everytime + #heapdump: '*' + keywords: - private - package