From 524e366dba2ab8e3d963f1e39035693ef178a19f Mon Sep 17 00:00:00 2001 From: Matthew Little Date: Thu, 16 Jan 2014 12:27:27 -0700 Subject: [PATCH] Added pool.start() so log event can be hooked in time for initialization --- lib/pool.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/pool.js b/lib/pool.js index fb2a786..bb6fd72 100644 --- a/lib/pool.js +++ b/lib/pool.js @@ -33,14 +33,11 @@ var pool = module.exports = function pool(options, authorizeFn){ var emitWarningLog = function(key, text) { _this.emit('log', 'warning', key, text); }; var emitErrorLog = function(key, text) { _this.emit('log', 'error' , key, text); }; - (function Init(){ - //timeout used so onLog event can be hooked before we start initializing - setTimeout(function(){ - SetupJobManager(); - SetupVarDiff(); - SetupDaemonInterface(); - }, 10); - })(); + this.start = function(){ + SetupJobManager(); + SetupVarDiff(); + SetupDaemonInterface(); + }; function SetupVarDiff(){