Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout timers should be cleared when requests are finished #50

Closed
stanmots opened this issue Apr 23, 2019 · 2 comments
Closed

Timeout timers should be cleared when requests are finished #50

stanmots opened this issue Apr 23, 2019 · 2 comments
Labels

Comments

@stanmots
Copy link

Hi, thanks for this great library.

I don't know whether this should be considered as a bug, but I see that timeout timers are not cleared even if the request promise has been resolved or rejected. Here is the relevant code line.

If you need an idea of how this can be fixed look at the following axios code snippet.

I think it's important to clear timers so that resources are not wasted without any purpose. As far as I can see, to implement this feature we need to call clearTimeout in the following cases:

  • Promise resolved
  • Promise rejected
  • AbortController called abort
@elbywan
Copy link
Owner

elbywan commented Apr 28, 2019

Hi @stanmots,

Hi, thanks for this great library.

Thanks 😄.

I don't know whether this should be considered as a bug, but I see that timeout timers are not cleared even if the request promise has been resolved or rejected

It's a bug indeed, I just released a new version with the fix. Thanks for pointing this out! 👍

@stanmots
Copy link
Author

Thanks for the quick fix 👍

@elbywan elbywan added the bug label May 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants