Skip to content

Commit 21a8f43

Browse files
committed
Fix compile issue
1 parent 20780dd commit 21a8f43

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

driver/src/main/java/org/neo4j/driver/internal/retry/ExponentialBackoffRetryLogic.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020

2121
import io.netty.util.concurrent.EventExecutor;
2222
import io.netty.util.concurrent.EventExecutorGroup;
23-
24-
import org.neo4j.driver.util.Experimental;
2523
import org.reactivestreams.Publisher;
2624
import reactor.core.publisher.Flux;
2725
import reactor.core.publisher.Mono;
@@ -47,6 +45,7 @@
4745
import org.neo4j.driver.exceptions.TransientException;
4846
import org.neo4j.driver.internal.util.Clock;
4947
import org.neo4j.driver.internal.util.Futures;
48+
import org.neo4j.driver.util.Experimental;
5049

5150
import static java.util.concurrent.TimeUnit.SECONDS;
5251

@@ -106,7 +105,7 @@ public <T> T retry( Supplier<T> work )
106105
catch ( Throwable throwable )
107106
{
108107
Throwable error = extractPossibleTerminationCause( throwable );
109-
if ( isRetryable( error ) )
108+
if ( canRetryOn( error ) )
110109
{
111110
long currentTime = clock.millis();
112111
if ( startTime == -1 )
@@ -148,6 +147,11 @@ public <T> Publisher<T> retryRx( Publisher<T> work )
148147
return Flux.from( work ).retryWhen( retryRxCondition() );
149148
}
150149

150+
protected boolean canRetryOn( Throwable error )
151+
{
152+
return isRetryable( error );
153+
}
154+
151155
@Experimental
152156
public static boolean isRetryable( Throwable error )
153157
{
@@ -186,7 +190,7 @@ private Function<Flux<Throwable>,Publisher<Context>> retryRxCondition()
186190
long startTime = ctx.getOrDefault( "startTime", -1L );
187191
long nextDelayMs = ctx.getOrDefault( "nextDelayMs", initialRetryDelayMs );
188192

189-
if ( isRetryable( error ) )
193+
if ( canRetryOn( error ) )
190194
{
191195
long currentTime = clock.millis();
192196
if ( startTime == -1 )
@@ -273,7 +277,7 @@ private <T> void retryOnError( CompletableFuture<T> resultFuture, Supplier<Compl
273277
List<Throwable> errors )
274278
{
275279
Throwable error = extractPossibleTerminationCause( throwable );
276-
if ( isRetryable( error ) )
280+
if ( canRetryOn( error ) )
277281
{
278282
long currentTime = clock.millis();
279283
if ( startTime == -1 )

0 commit comments

Comments
 (0)