From 0c05da92856e4accde6467caef9d63d57c7981d8 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Tue, 25 Jul 2017 17:16:59 +0700 Subject: [PATCH] Add comment --- services/mongoose.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/mongoose.js b/services/mongoose.js index c11bdbb78..2b05aaeaa 100644 --- a/services/mongoose.js +++ b/services/mongoose.js @@ -44,6 +44,10 @@ if (enabled('talk:db')) { if (WEBPACK) { console.warn('Not connecting to mongodb during webpack build'); + + // @wyattjoh: We didn't call connect, but because we include mongoose, it will hold the socket ready, + // preventing node from exiting. Calling disconnect here just ensures that the application + // can quit correctly. mongoose.disconnect(); } else {