@@ -375,6 +375,7 @@ export async function startTunnelBinary(ctx: Context) {
375375 }
376376 if ( tunnelConfig ?. v ) {
377377 tunnelArguments . v = tunnelConfig . v
378+ tunnelArguments . logLevel = 'debug'
378379 }
379380 if ( tunnelConfig ?. logFile ) {
380381 tunnelArguments . logFile = tunnelConfig . logFile
@@ -394,8 +395,8 @@ export async function startTunnelBinary(ctx: Context) {
394395 if ( ctx . config . tunnel ?. type === 'auto' ) {
395396 tunnelInstance = new lambdaTunnel ( ) ;
396397 const istunnelStarted = await tunnelInstance . start ( tunnelArguments ) ;
397- ctx . log . debug ( 'Tunnel is started Successfully' ) ;
398- const tunnelRunningStatus = tunnelInstance . isRunning ( ) ;
398+ ctx . log . debug ( 'Tunnel is started Successfully with status ' + istunnelStarted ) ;
399+ const tunnelRunningStatus = await tunnelInstance . isRunning ( ) ;
399400 ctx . log . debug ( 'Running status of tunnel after start ? ' + tunnelRunningStatus ) ;
400401 }
401402}
@@ -416,7 +417,7 @@ export async function startPollingForTunnel(ctx: Context, build_id: string, base
416417 ctx . log . info ( "Error: Build data is null." ) ;
417418 clearInterval ( intervalId ) ;
418419
419- const tunnelRunningStatus = tunnelInstance . isRunning ( ) ;
420+ const tunnelRunningStatus = await tunnelInstance . isRunning ( ) ;
420421 ctx . log . debug ( 'Running status of tunnel before stopping ? ' + tunnelRunningStatus ) ;
421422
422423 const status = await tunnelInstance . stop ( ) ;
@@ -428,7 +429,7 @@ export async function startPollingForTunnel(ctx: Context, build_id: string, base
428429 if ( resp . build . build_status_ind === constants . BUILD_COMPLETE || resp . build . build_status_ind === constants . BUILD_ERROR ) {
429430 clearInterval ( intervalId ) ;
430431
431- const tunnelRunningStatus = tunnelInstance . isRunning ( ) ;
432+ const tunnelRunningStatus = await tunnelInstance . isRunning ( ) ;
432433 ctx . log . debug ( 'Running status of tunnel before stopping ? ' + tunnelRunningStatus ) ;
433434
434435 const status = await tunnelInstance . stop ( ) ;
@@ -447,5 +448,15 @@ export async function startPollingForTunnel(ctx: Context, build_id: string, base
447448 } , 5000 ) ;
448449}
449450
451+ export async function stopTunnelHelper ( ctx : Context ) {
452+ const tunnelRunningStatus = await tunnelInstance . isRunning ( ) ;
453+ ctx . log . debug ( 'Running status of tunnel before stopping ? ' + tunnelRunningStatus ) ;
454+
455+ if ( tunnelRunningStatus ) {
456+ const status = await tunnelInstance . stop ( ) ;
457+ ctx . log . debug ( 'Tunnel is Stopped ? ' + status ) ;
458+ }
459+ }
460+
450461
451462
0 commit comments