fix(Xapi#call): retries on TOO_MANY_PENDING_TASKS
Fixes fix vatesfr/xo-web#861
This commit is contained in:
parent
d7ecb32238
commit
4778274c97
10
src/xapi.js
10
src/xapi.js
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user