Skip to content

Commit

Permalink
fix: adding connection keepalive for eventsender channel (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklasl authored Apr 22, 2024
1 parent b14e7d3 commit 394e377
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/com/spotify/confidence/Confidence.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import io.grpc.ManagedChannelBuilder;
import java.io.Closeable;
import java.io.IOException;
import java.time.Duration;
import java.time.Instant;
import java.util.Map;
import java.util.Optional;
Expand Down Expand Up @@ -203,7 +204,9 @@ public static class Builder {
private final Closer closer = Closer.create();

private final ManagedChannel DEFAULT_CHANNEL =
ManagedChannelBuilder.forAddress("edge-grpc.spotify.com", 443).build();
ManagedChannelBuilder.forAddress("edge-grpc.spotify.com", 443)
.keepAliveTime(Duration.ofMinutes(5).getSeconds(), TimeUnit.SECONDS)
.build();
private ManagedChannel flagResolverManagedChannel = DEFAULT_CHANNEL;

public Builder(@Nonnull String clientSecret) {
Expand Down

0 comments on commit 394e377

Please sign in to comment.