Open GnidaKid69 opened 5 years ago
Does not work for me too
For me too
Not work either.
version: 4.2.4
I have same problem. version: 4.2.2
nobody interested to solve this?
I've the same problem v.4.2.4
i temporaly fix it by this
return new Promise((resolve, reject) => {
const request = rp(options);
request.then(res => {
clearTimeout(timeout);
resolve(res);
}).catch(error => {
clearTimeout(timeout);
reject(error);
})
const timeout = setTimeout(() => {
request.cancel();
reject(new Error("Timeout more than 45 secs"));
}, 1000 * 45);
});
maybe the cancel() not work, because in specific cases i get the error
(node:21056) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 pipe listeners added. Use emitter.setMaxListeners() to increase limit
It happend if inner timeout was called 10 times. So i guess it depends on this strange behaviour.
4.2.2 same problem
bump
I have a list of URLs where I want to make a request so I am using forEach and do all the requests with proxies and if proxy fails it moves on next one that's basically how my code works. I have set the timeout on 2000 ms and I am expecting it to drop request after that time give me an error and switch to another proxy but it's not doing that I guess. When it's checking last few links it takes too much time. I have 200 URLs to make a request on and last 10 or so takes more time than other 190. I think it's because the timeout is not working.