From 1d3616ae71d5d7d1059e08031579c376247fd322 Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Wed, 4 Mar 2015 17:41:50 +0100 Subject: [PATCH] Minor changes. --- packages/xo-lib/xo.js | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/packages/xo-lib/xo.js b/packages/xo-lib/xo.js index 00c31e051..ec58ca925 100644 --- a/packages/xo-lib/xo.js +++ b/packages/xo-lib/xo.js @@ -30,19 +30,6 @@ function noop() {} //==================================================================== -//==================================================================== - -var objectsOptions = { - indexes: [ - 'ref', - 'type', - 'UUID', - ], - key: function (item) { - return item.UUID || item.ref; - }, -}; - // Try connecting to Xo-Server. function tryConnect() { /* jshint validthis: true */ @@ -127,10 +114,17 @@ function Xo(opts) { } this._api = new Api(opts.url); - this._backOff = new BackOff(function () { - return fibonacci(1e3); + this._backOff = new BackOff(); + this.objects = createCollection({ + indexes: [ + 'ref', + 'type', + 'UUID', + ], + key: function (item) { + return item.UUID || item.ref; + }, }); - this.objects = createCollection(objectsOptions); this.status = 'disconnected'; self._api.on('connected', function () {