File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -345,6 +345,14 @@ declare namespace CircuitBreaker {
345345 */
346346 abortController ?: AbortController | undefined ;
347347
348+ /**
349+ * Automatically recreates the instance of AbortController whenever the circuit transitions to
350+ * 'halfOpen' or 'closed' state. This ensures that new requests are not
351+ * impacted by previous signals that were triggered when the circuit was 'open'.
352+ * @default false
353+ */
354+ autoRenewAbortController ?: boolean | undefined ;
355+
348356 /**
349357 * Whether to enable the periodic snapshots that are emitted by the Status class.
350358 * Passing false will result in snapshots not being emitted
Original file line number Diff line number Diff line change @@ -50,7 +50,10 @@ breaker = new CircuitBreaker(async () => true, {
5050 flush : ( ) => { } ,
5151 } ,
5252} ) ;
53- breaker = new CircuitBreaker ( async ( ) => true , { abortController : new AbortController ( ) } ) ;
53+ breaker = new CircuitBreaker ( async ( ) => true , {
54+ abortController : new AbortController ( ) ,
55+ autoRenewAbortController : true ,
56+ } ) ;
5457breaker = new CircuitBreaker ( async ( ) => true , { enableSnapshots : true } ) ;
5558breaker = new CircuitBreaker ( async ( ) => true , { rotateBucketController : new EventEmitter ( ) } ) ;
5659
You can’t perform that action at this time.
0 commit comments