Skip to content

Commit

Permalink
By default set client idle timeout (#2371)
Browse files Browse the repository at this point in the history
Having no idle timeout by default is not the right choice. Most modern environments (e.g. every cloud, every proxy) forget about idle connections fairly quickly. For example, I have worked with proxies that forgot about connections after an idle time of as low as 90 seconds.

In this change we set the default idle time to 50 seconds.
  • Loading branch information
erikvanoosten authored Aug 12, 2023
1 parent 37fe777 commit 58e5284
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zio-http/src/main/scala/zio/http/ZClient.scala
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ object ZClient {
localAddress = None,
addUserAgentHeader = true,
webSocketConfig = WebSocketConfig.default,
idleTimeout = None,
idleTimeout = Some(50.seconds),
connectionTimeout = None,
)
}
Expand Down

0 comments on commit 58e5284

Please sign in to comment.