Skip to content

Commit 6e10af1

Browse files
committed
make connect_timeout work with DNS resolution
Before it could timeout connection process, but still wait for DNS resolution for long time. It's possible to interrupt addrinfo in ruby 3+
1 parent a715e05 commit 6e10af1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/webpacker/dev_server.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def initialize(config)
1313

1414
def running?
1515
if config.dev_server.present?
16-
Socket.tcp(host, port, connect_timeout: connect_timeout).close
16+
Timeout.timeout(connect_timeout) { Socket.tcp(host, port).close }
1717
true
1818
else
1919
false

0 commit comments

Comments
 (0)