File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,23 @@ if (process.env.HTTP_SERVER_DISABLED !== "true") {
6262 } ) ;
6363
6464 // Handle shutdowns gracefully
65- createTerminus ( server , { signals : [ "SIGINT" , "SIGTERM" ] , timeout : 5000 } ) ;
65+ createTerminus ( server , {
66+ signals : [ "SIGINT" , "SIGTERM" ] ,
67+ timeout : process . env . GRACEFUL_SHUTDOWN_TIMEOUT
68+ ? Number ( process . env . GRACEFUL_SHUTDOWN_TIMEOUT )
69+ : 5000 ,
70+ onSignal : async ( ) => {
71+ console . log ( "[terminus] onSignal: starting cleanup" ) ;
72+ } ,
73+ onShutdown : async ( ) => {
74+ console . log ( "[terminus] onShutdown: cleanup finished, server is shutting down" ) ;
75+ } ,
76+ onSendFailureDuringShutdown : async ( ) => {
77+ console . log (
78+ "[terminus] onSendFailureDuringShutdown: cleanup finished, server is shutting down"
79+ ) ;
80+ } ,
81+ } ) ;
6682} else {
6783 console . log ( `✅ app ready (skipping http server)` ) ;
6884}
You can’t perform that action at this time.
0 commit comments