@@ -6,8 +6,6 @@ module Spring
6
6
module Client
7
7
class Run < Command
8
8
FORWARDED_SIGNALS = %w( INT QUIT USR1 USR2 INFO WINCH ) & Signal . list . keys
9
- CONNECT_TIMEOUT = 1
10
- BOOT_TIMEOUT = 20
11
9
12
10
attr_reader :server
13
11
@@ -74,7 +72,7 @@ def boot_server
74
72
env . socket_path . unlink if env . socket_path . exist?
75
73
76
74
pid = Process . spawn ( server_process_env , env . server_command , out : File ::NULL )
77
- timeout = Time . now + BOOT_TIMEOUT
75
+ timeout = Time . now + String . boot_timeout
78
76
79
77
@server_booted = true
80
78
@@ -85,7 +83,7 @@ def boot_server
85
83
exit status . exitstatus
86
84
elsif Time . now > timeout
87
85
$stderr. puts "Starting Spring server with `#{ env . server_command } ` " \
88
- "timed out after #{ BOOT_TIMEOUT } seconds"
86
+ "timed out after #{ Spring . boot_timeout } seconds"
89
87
exit 1
90
88
end
91
89
@@ -122,7 +120,7 @@ def stop_server
122
120
end
123
121
124
122
def verify_server_version
125
- unless IO . select ( [ server ] , [ ] , [ ] , CONNECT_TIMEOUT )
123
+ unless IO . select ( [ server ] , [ ] , [ ] , Spring . connect_timeout )
126
124
raise "Error connecting to Spring server"
127
125
end
128
126
@@ -151,7 +149,7 @@ def connect_to_application(client)
151
149
server . send_io client
152
150
send_json server , "args" => args , "default_rails_env" => default_rails_env , "spawn_env" => spawn_env , "reset_env" => reset_env
153
151
154
- if IO . select ( [ server ] , [ ] , [ ] , CONNECT_TIMEOUT )
152
+ if IO . select ( [ server ] , [ ] , [ ] , Spring . connect_timeout )
155
153
server . gets or raise CommandNotFound
156
154
else
157
155
raise "Error connecting to Spring server"
0 commit comments