settings: Insight.js refactor

This commit is contained in:
Manuel Araoz 2014-09-03 15:05:44 -03:00
commit 3e9328f951

View file

@ -45,6 +45,7 @@ var Insight = function(opts) {
'secure': opts.schema === 'https'
};
this.socket = this.getSocket();
}
util.inherits(Insight, EventEmitter);
@ -105,7 +106,7 @@ Insight.prototype._setMainHandlers = function(url, opts) {
/** @private */
Insight.prototype.getSocket = function(url, opts) {
Insight.prototype.getSocket = function() {
if (!this.socket) {
this.socket = this._getSocketIO(this.url, this.opts);