@@ -186,6 +186,22 @@ async fn main() {
186
186
let api_port = * API_SERVER_PORT ;
187
187
info ! ( "Try to start the API server on 'http://localhost:{api_port}'..." ) ;
188
188
189
+ // The shutdown configuration for the runtime API server:
190
+ let mut shutdown = Shutdown {
191
+ // We do not want to use the Ctrl+C signal to stop the server:
192
+ ctrlc : false ,
193
+
194
+ // Everything else is set to default for now:
195
+ ..Shutdown :: default ( )
196
+ } ;
197
+
198
+ #[ cfg( unix) ]
199
+ {
200
+ // We do not want to use the termination signal to stop the server.
201
+ // This option, however, is only available on Unix systems:
202
+ shutdown. signals = HashSet :: new ( ) ;
203
+ }
204
+
189
205
// Configure the runtime API server:
190
206
let figment = Figment :: from ( rocket:: Config :: release_default ( ) )
191
207
@@ -213,17 +229,7 @@ async fn main() {
213
229
. merge ( ( "tls.key" , certificate_data. key_pair . serialize_pem ( ) . as_bytes ( ) ) )
214
230
215
231
// Set the shutdown configuration:
216
- . merge ( ( "shutdown" , Shutdown {
217
-
218
- // Again, we do not want to use the Ctrl+C signal to stop the server:
219
- ctrlc : false ,
220
-
221
- // We do not want to use the termination signal to stop the server:
222
- signals : HashSet :: new ( ) ,
223
-
224
- // Everything else is set to default:
225
- ..Shutdown :: default ( )
226
- } ) ) ;
232
+ . merge ( ( "shutdown" , shutdown) ) ;
227
233
228
234
//
229
235
// Start the runtime API server in a separate thread. This is necessary
0 commit comments