File tree 2 files changed +4
-1
lines changed
src/main/java/dev/failsafe/internal
2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -44,8 +44,9 @@ public synchronized void handleConfigChange() {
44
44
*/
45
45
@ Override
46
46
synchronized void checkThreshold (ExecutionContext <R > context ) {
47
- // Execution threshold will only be set for time based thresholding
47
+ // Execution threshold can only be set for time based thresholding
48
48
if (stats .getExecutionCount () >= config .getFailureExecutionThreshold ()) {
49
+ // Failure rate threshold can only be set for time based thresholding
49
50
double failureRateThreshold = config .getFailureRateThreshold ();
50
51
if ((failureRateThreshold != 0 && stats .getFailureRate () >= failureRateThreshold ) || (failureRateThreshold == 0
51
52
&& stats .getFailureCount () >= config .getFailureThreshold ()))
Original file line number Diff line number Diff line change @@ -68,8 +68,10 @@ synchronized void checkThreshold(ExecutionContext<R> context) {
68
68
successesExceeded = stats .getSuccessCount () >= successThreshold ;
69
69
failuresExceeded = stats .getFailureCount () > successThresholdingCapacity - successThreshold ;
70
70
} else {
71
+ // Failure rate threshold can only be set for time based thresholding
71
72
int failureRateThreshold = config .getFailureRateThreshold ();
72
73
if (failureRateThreshold != 0 ) {
74
+ // Execution threshold can only be set for time based thresholding
73
75
boolean executionThresholdExceeded = stats .getExecutionCount () >= config .getFailureExecutionThreshold ();
74
76
failuresExceeded = executionThresholdExceeded && stats .getFailureRate () >= failureRateThreshold ;
75
77
successesExceeded = executionThresholdExceeded && stats .getSuccessRate () > 100 - failureRateThreshold ;
You can’t perform that action at this time.
0 commit comments