Skip to content

Commit 3644616

Browse files
authored
Make canRetryOn function public. (#764)
* Make canRetryOn function public. Make it static and rename it to isRetryable. To be used as experimental API. * Fix compile issue Co-authored-by: Gregory Woods <[email protected]>
2 parents b20a89b + 21a8f43 commit 3644616

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import org.neo4j.driver.exceptions.TransientException;
4646
import org.neo4j.driver.internal.util.Clock;
4747
import org.neo4j.driver.internal.util.Futures;
48+
import org.neo4j.driver.util.Experimental;
4849

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

@@ -147,6 +148,12 @@ public <T> Publisher<T> retryRx( Publisher<T> work )
147148
}
148149

149150
protected boolean canRetryOn( Throwable error )
151+
{
152+
return isRetryable( error );
153+
}
154+
155+
@Experimental
156+
public static boolean isRetryable( Throwable error )
150157
{
151158
return error instanceof SessionExpiredException || error instanceof ServiceUnavailableException || isTransientError( error );
152159
}

0 commit comments

Comments
 (0)