diff --git a/src/main/java/io/lettuce/core/SocketOptions.java b/src/main/java/io/lettuce/core/SocketOptions.java index bdad0baf43..1443ba7a30 100644 --- a/src/main/java/io/lettuce/core/SocketOptions.java +++ b/src/main/java/io/lettuce/core/SocketOptions.java @@ -280,7 +280,7 @@ public static class KeepAliveOptions { public static final Duration DEFAULT_IDLE = Duration.ofHours(2); - public static final Duration DEFAULT_INTERVAL = Duration.ofSeconds(1); + public static final Duration DEFAULT_INTERVAL = Duration.ofSeconds(75); private final int count; @@ -390,7 +390,7 @@ public KeepAliveOptions.Builder idle(Duration idle) { } /** - * The time between individual keepalive probes. Defaults to {@code 1 second}. See also {@link #DEFAULT_INTERVAL} + * The time between individual keepalive probes. Defaults to {@code 75 second}. See also {@link #DEFAULT_INTERVAL} * and {@code TCP_KEEPINTVL}. *

* The time granularity of is seconds. diff --git a/src/test/java/io/lettuce/core/KeepAliveOptionsUnitTests.java b/src/test/java/io/lettuce/core/KeepAliveOptionsUnitTests.java index e8261c79c3..db927ba4a4 100644 --- a/src/test/java/io/lettuce/core/KeepAliveOptionsUnitTests.java +++ b/src/test/java/io/lettuce/core/KeepAliveOptionsUnitTests.java @@ -35,6 +35,9 @@ void testNew() { KeepAliveOptions disabled = KeepAliveOptions.builder().build(); assertThat(disabled).isNotNull(); + assertThat(disabled.getIdle()).hasHours(2); + assertThat(disabled.getInterval()).hasSeconds(75); + assertThat(disabled.getCount()).isEqualTo(9); } @Test