Open protometa opened 2 years ago
When using the throttle
option in the app
call, things break in various ways when the app requested is not available.
> for(var i=0;i<5;i++){gplay.app({appId:`does.not.exist.${i}`,throttle:3}).then(it=>{console.log('ok')}).catch(it=>{console.log('oops')})}
Promise {
<pending>,
[Symbol(async_id_symbol)]: 2121,
[Symbol(trigger_async_id_symbol)]: 2120
}
... no further output. Ever. I suspect the throttled workers just died cause when processing my 4k appIds, it gets slower for every missing app and then stops.
Same output as without throttle:
> for(var i=0;i<5;i++){gplay.app({appId:`does.not.exist.${i}`}).then(it=>{console.log('ok')}).catch(it=>{console.log('oops')})}
Promise {
<pending>,
[Symbol(async_id_symbol)]: 4092269,
[Symbol(trigger_async_id_symbol)]: 4092268
}
> oops
oops
oops
oops
oops
Description:
The throttling code does not handle errors and hangs.
Example code:
See failing test in PR #521
Error message:
No error just hangs.