@@ -6,8 +6,6 @@ module Spring
66 module Client
77 class Run < Command
88 FORWARDED_SIGNALS = %w( INT QUIT USR1 USR2 INFO WINCH ) & Signal . list . keys
9- CONNECT_TIMEOUT = 1
10- BOOT_TIMEOUT = 20
119
1210 attr_reader :server
1311
@@ -74,7 +72,7 @@ def boot_server
7472 env . socket_path . unlink if env . socket_path . exist?
7573
7674 pid = Process . spawn ( server_process_env , env . server_command , out : File ::NULL )
77- timeout = Time . now + BOOT_TIMEOUT
75+ timeout = Time . now + Spring . boot_timeout
7876
7977 @server_booted = true
8078
@@ -85,7 +83,7 @@ def boot_server
8583 exit status . exitstatus
8684 elsif Time . now > timeout
8785 $stderr. puts "Starting Spring server with `#{ env . server_command } ` " \
88- "timed out after #{ BOOT_TIMEOUT } seconds"
86+ "timed out after #{ Spring . boot_timeout } seconds"
8987 exit 1
9088 end
9189
@@ -122,7 +120,7 @@ def stop_server
122120 end
123121
124122 def verify_server_version
125- unless IO . select ( [ server ] , [ ] , [ ] , CONNECT_TIMEOUT )
123+ unless IO . select ( [ server ] , [ ] , [ ] , Spring . connect_timeout )
126124 raise "Error connecting to Spring server"
127125 end
128126
@@ -151,7 +149,7 @@ def connect_to_application(client)
151149 server . send_io client
152150 send_json server , "args" => args , "default_rails_env" => default_rails_env , "spawn_env" => spawn_env , "reset_env" => reset_env
153151
154- if IO . select ( [ server ] , [ ] , [ ] , CONNECT_TIMEOUT )
152+ if IO . select ( [ server ] , [ ] , [ ] , Spring . connect_timeout )
155153 server . gets or raise CommandNotFound
156154 else
157155 raise "Error connecting to Spring server"
0 commit comments