fix(Xapi#call): retries on TOO_MANY_PENDING_TASKS

Fixes fix vatesfr/xo-web#861
This commit is contained in:
Julien Fontanet 2016-04-27 09:28:36 +02:00
parent d7ecb32238
commit 4778274c97

View File

@ -243,6 +243,16 @@ export default class Xapi extends XapiBase {
this.objects.on('update', onAddOrUpdate)
}
call (...args) {
const fn = super.call
const loop = () => fn.apply(this, args)::pCatch({
code: 'TOO_MANY_PENDING_TASKS'
}, () => pDelay(5e3).then(loop))
return loop()
}
// =================================================================
_registerGenericWatcher (fn) {