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

feat: support timeout and AbortController #268

Merged
merged 12 commits into from
Aug 22, 2023

Conversation

picunada
Copy link
Contributor

πŸ”— Linked issue

Issue #21

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Added timeout feature.
Added timeoutExponent parameter to specify function to increase timeout over retries.
Added test for new feature.
Added documentation for new feature(maybe need fixes, sorry for my english).

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codecov
Copy link

codecov bot commented Aug 18, 2023

Codecov Report

Merging #268 (8d3dd29) into main (2be558c) will increase coverage by 0.35%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #268      +/-   ##
==========================================
+ Coverage   91.75%   92.10%   +0.35%     
==========================================
  Files           5        5              
  Lines         473      494      +21     
  Branches       79       85       +6     
==========================================
+ Hits          434      455      +21     
  Misses         39       39              
Files Changed Coverage Ξ”
src/fetch.ts 97.02% <100.00%> (+0.20%) ⬆️
src/node.ts 57.14% <100.00%> (+4.51%) ⬆️

@picunada
Copy link
Contributor Author

picunada commented Aug 18, 2023

Hello, sorry for possible mistakes in README.md, if this feature will be moved on check documentation, thanks.

@pi0 pi0 changed the title feat: implemented timeout with exponential increase over retries feat: support timeout and AbortController Aug 22, 2023
@pi0
Copy link
Member

pi0 commented Aug 22, 2023

Thanks for the nice PR dear @picunada ❀️ I have made few refactors to keep the feature simple (we might think about using interceptors to have advanced usages like exponential timeout increase) also exposing AbortController which is an important part in this.

@pi0 pi0 merged commit 98396ec into unjs:main Aug 22, 2023
6 checks passed
@picunada picunada deleted the feat/implement-timeout branch August 22, 2023 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants