mirror of
https://github.com/mclueppers/xo-server.git
synced 2025-07-29 00:44:43 +02:00
Events logging for debugging.
This commit is contained in:
parent
e8b1be6568
commit
424c6403e1
10
src/xapi.js
10
src/xapi.js
@ -52,7 +52,9 @@ Xapi.prototype.call = function (method) {
|
|||||||
// no longer pool master (`event.next`), so we have to
|
// no longer pool master (`event.next`), so we have to
|
||||||
// retry at least once to know who is the new pool master.
|
// retry at least once to know who is the new pool master.
|
||||||
if (('ECONNRESET' === current)
|
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
|
// Node.js seems to reuse the broken socket, so we add
|
||||||
// a small delay.
|
// a small delay.
|
||||||
@ -62,12 +64,6 @@ Xapi.prototype.call = function (method) {
|
|||||||
return Q.delay(1000).then(helper);
|
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.
|
// XAPI is sometimes reinitialized and sessions are lost.
|
||||||
// We try log in again if necessary.
|
// We try log in again if necessary.
|
||||||
if ('SESSION_INVALID' === current)
|
if ('SESSION_INVALID' === current)
|
||||||
|
@ -325,6 +325,8 @@ Xo.prototype.start = function (cfg) {
|
|||||||
record.id = event.ref;
|
record.id = event.ref;
|
||||||
record.pool = pool_id;
|
record.pool = pool_id;
|
||||||
|
|
||||||
|
console.log(xapi.host, event.class, event.ref);
|
||||||
|
|
||||||
// @todo Handle operation types.
|
// @todo Handle operation types.
|
||||||
collection.add(event.snapshot, {'replace': true});
|
collection.add(event.snapshot, {'replace': true});
|
||||||
|
|
||||||
@ -346,7 +348,7 @@ Xo.prototype.start = function (cfg) {
|
|||||||
});
|
});
|
||||||
}();
|
}();
|
||||||
}).fail(function (error) {
|
}).fail(function (error) {
|
||||||
console.error(error);
|
console.error(xapi.host, error);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
// Connect existing servers.
|
// Connect existing servers.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user