Skip to content

Commit

Permalink
Fix compile issue
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmwoods committed Oct 2, 2020
1 parent 20780dd commit 21a8f43
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

import io.netty.util.concurrent.EventExecutor;
import io.netty.util.concurrent.EventExecutorGroup;

import org.neo4j.driver.util.Experimental;
import org.reactivestreams.Publisher;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
Expand All @@ -47,6 +45,7 @@
import org.neo4j.driver.exceptions.TransientException;
import org.neo4j.driver.internal.util.Clock;
import org.neo4j.driver.internal.util.Futures;
import org.neo4j.driver.util.Experimental;

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

Expand Down Expand Up @@ -106,7 +105,7 @@ public <T> T retry( Supplier<T> work )
catch ( Throwable throwable )
{
Throwable error = extractPossibleTerminationCause( throwable );
if ( isRetryable( error ) )
if ( canRetryOn( error ) )
{
long currentTime = clock.millis();
if ( startTime == -1 )
Expand Down Expand Up @@ -148,6 +147,11 @@ public <T> Publisher<T> retryRx( Publisher<T> work )
return Flux.from( work ).retryWhen( retryRxCondition() );
}

protected boolean canRetryOn( Throwable error )
{
return isRetryable( error );
}

@Experimental
public static boolean isRetryable( Throwable error )
{
Expand Down Expand Up @@ -186,7 +190,7 @@ private Function<Flux<Throwable>,Publisher<Context>> retryRxCondition()
long startTime = ctx.getOrDefault( "startTime", -1L );
long nextDelayMs = ctx.getOrDefault( "nextDelayMs", initialRetryDelayMs );

if ( isRetryable( error ) )
if ( canRetryOn( error ) )
{
long currentTime = clock.millis();
if ( startTime == -1 )
Expand Down Expand Up @@ -273,7 +277,7 @@ private <T> void retryOnError( CompletableFuture<T> resultFuture, Supplier<Compl
List<Throwable> errors )
{
Throwable error = extractPossibleTerminationCause( throwable );
if ( isRetryable( error ) )
if ( canRetryOn( error ) )
{
long currentTime = clock.millis();
if ( startTime == -1 )
Expand Down

0 comments on commit 21a8f43

Please sign in to comment.