Various updates.

This commit is contained in:
Julien Fontanet 2013-10-02 19:02:33 +02:00
parent 10edf58bf9
commit 1f09d9e8b9

View File

@ -249,7 +249,24 @@ Xo.prototype.start = function (cfg) {
'replace': true,
});
});
})).fail(function (error) {
})).then(function () {
return xapi.call('event.register', ['*']);
}).then(function () {
return function loop() {
return xapi.call('event.next').then(function (event) {
event = event[0]; // @todo Handle multiple events.
var collection = xobjs[event.class];
if (collection)
{
// @todo Handle operation types.
collection.add(event.snapshot, {'replace': true});
}
return loop();
});
}();
}).fail(function (error) {
console.error(error);
});
};