File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -66,14 +66,19 @@ export async function start (client, selectedRuntime) {
6666 await server . close ( )
6767 }
6868
69- process . once ( 'SIGINT' , async ( ) => {
70- process . on ( 'SIGINT' , ( ) => {
71- // we ignore future signals to avoid double shutdown
72- } )
69+ async function recordAndShutdown ( ) {
70+ console . log ( 'SIGINT received, recording metrics and shutting down...' )
7371 clearTimeout ( recordTimeout )
7472 await recordMetrics ( entrypointUrl )
7573 await shutdown ( )
7674 process . removeAllListeners ( 'SIGINT' )
75+ }
76+
77+ process . once ( 'SIGINT' , ( ) => {
78+ process . on ( 'SIGINT' , ( ) => {
79+ // we ignore future signals to avoid double shutdown
80+ } )
81+ recordAndShutdown ( )
7782 } )
7883
7984 const { statusCode, body } = await requestRecord ( 'start' )
You can’t perform that action at this time.
0 commit comments