diff --git a/src/xapi.js b/src/xapi.js index c2b4698..a864eda 100644 --- a/src/xapi.js +++ b/src/xapi.js @@ -52,7 +52,9 @@ Xapi.prototype.call = function (method) { // no longer pool master (`event.next`), so we have to // retry at least once to know who is the new pool master. if (('ECONNRESET' === current) - || ('ECONNREFUSED' === current)) + || ('ECONNREFUSED' === current) // More or less similar to above. + || ('HOST_STILL_BOOTING' === current) + || ('HOST_HAS_NO_MANAGEMENT_IP' === current)) // Similar to above. { // Node.js seems to reuse the broken socket, so we add // a small delay. @@ -62,12 +64,6 @@ Xapi.prototype.call = function (method) { return Q.delay(1000).then(helper); } - // - if ('HOST_STILL_BOOTING' === current) - { - return Q.delay(2000).then(helper); - } - // XAPI is sometimes reinitialized and sessions are lost. // We try log in again if necessary. if ('SESSION_INVALID' === current) diff --git a/src/xo.js b/src/xo.js index 3b2ce7c..1f6210f 100644 --- a/src/xo.js +++ b/src/xo.js @@ -325,6 +325,8 @@ Xo.prototype.start = function (cfg) { record.id = event.ref; record.pool = pool_id; + console.log(xapi.host, event.class, event.ref); + // @todo Handle operation types. collection.add(event.snapshot, {'replace': true}); @@ -346,7 +348,7 @@ Xo.prototype.start = function (cfg) { }); }(); }).fail(function (error) { - console.error(error); + console.error(xapi.host, error); }); }; // Connect existing servers.