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: renewing the AbortController when the circuit enters the 'halfClose' or 'close' state #892

Merged
merged 3 commits into from
Oct 28, 2024

Conversation

WillianAgostini
Copy link
Contributor

Introducing a new option to the CircuitBreaker: autoRenewAbortController. When enabled, this flag automatically recreates the AbortController whenever the CircuitBreaker state transitions to 'halfOpen' or 'closed'. This ensures the controller is reset and ready for reuse in subsequent state changes.

Closes #861

…pecific states

When state changes to 'halfOpen' or 'close', the AbortController will be recreated to handle reuse.

nodeshift#861
@coveralls
Copy link

coveralls commented Oct 25, 2024

Pull Request Test Coverage Report for Build 11553426220

Details

  • 16 of 16 (100.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.06%) to 98.321%

Files with Coverage Reduction New Missed Lines %
lib/circuit.js 1 98.49%
Totals Coverage Status
Change from base Build 11481851974: 0.06%
Covered Lines: 402
Relevant Lines: 403

💛 - Coveralls

Copy link
Member

@lholmquist lholmquist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also update the README in the abort controller section mentioning this new feature?

@WillianAgostini
Copy link
Contributor Author

Could you also update the README in the abort controller section mentioning this new feature?

I've added a new commit that updates the README in the abort controller section

@lholmquist lholmquist merged commit 2ba3a31 into nodeshift:main Oct 28, 2024
15 checks passed
@WillianAgostini WillianAgostini deleted the feat/reusable-abort-signal branch October 28, 2024 14:31
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.

AbortController break fetch after first timeout because aborted signal can't be re-used
3 participants