Closed mohamed94eda closed 2 years ago
hello @mohamed94eda it seems this is similar issue than #11 , it seems to be related with some issue with nodejs itself that has been reported before but i am still unable to figure out a solution, but could you try adding a timeout
to see what happens ?
I did add the on('timeout)
But it doesn't get invoked either.
I noticed if connection drops for +60 sec this happens.
But if less than +-60 sec the download resumes as expected
@mohamed94eda you need to add the timeout to the options you have, like this
const timeout = 1000 * 10; // 10 seconds
const options = {
retry: { maxRetries: 5, delay: 2500 },
override: true,
removeOnFail: true,
progressThrottle: 1000,
httpRequestOptions: { timeout },
httpsRequestOptions: { timeout },
}
It does invoke the retrying attempts, but then throws an err ENOENT : no such file or directory
I can workaround it by settingremoveOnFail: false
It does invoke the retrying attempts, but then throws an err
ENOENT : no such file or directory
I can workaround it by setting
removeOnFail: false
Tried to refactor my code and increase the timeout you mentioned and yes it does workaround the issue, maybe include the timeout as an option in your package, great finding
@mohamed94eda glad to here! yeap probably i will include it as a single timeout
option instead of httpsRequestOptions: { timeout }
in the future! Thanks for the suggestion,
closing this
Download hangs out if connection drops mid-progress and and doesn't emit any sign, when connection come back it still hanging .
`let options = { retry: { maxRetries: 5, delay: 2500 }, override: true, removeOnFail: true, progressThrottle: 1000,
};`