Skip to content

Commit

Permalink
Change default KeepAlive interval to 75 seconds #1671
Browse files Browse the repository at this point in the history
  • Loading branch information
yangbodong22011 authored Mar 19, 2021
1 parent 60db259 commit 0d6bddf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/io/lettuce/core/SocketOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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}.
* <p>
* The time granularity of is seconds.
Expand Down
3 changes: 3 additions & 0 deletions src/test/java/io/lettuce/core/KeepAliveOptionsUnitTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0d6bddf

Please sign in to comment.