@@ -324,7 +324,7 @@ export async function startPolling(ctx: Context, build_id: string, baseline: boo
324324
325325export let pingIntervalId : NodeJS . Timeout | null = null ;
326326
327- export async function startPingPolling ( ctx : Context ) : Promise < void > {
327+ export async function startPingPolling ( ctx : Context , event : string ) : Promise < void > {
328328 try {
329329 ctx . log . debug ( 'Sending initial ping to server...' ) ;
330330 await ctx . client . ping ( ctx . build . id , ctx . log ) ;
@@ -336,9 +336,9 @@ export async function startPingPolling(ctx: Context): Promise<void> {
336336 // Start the polling interval
337337 pingIntervalId = setInterval ( async ( ) => {
338338 try {
339- ctx . log . debug ( 'Sending ping to server...' ) ;
339+ ctx . log . debug ( 'Sending ping to server...' + event ) ;
340340 await ctx . client . ping ( ctx . build . id , ctx . log ) ;
341- ctx . log . debug ( 'Ping sent successfully.' ) ;
341+ ctx . log . debug ( 'Ping sent successfully.' + event ) ;
342342 } catch ( error : any ) {
343343 ctx . log . error ( `Error during ping polling: ${ error . message } ` ) ;
344344 }
@@ -390,6 +390,11 @@ export async function startTunnelBinary(ctx: Context) {
390390 ctx . config . tunnel . tunnelName = randomTunnelName
391391 }
392392
393+ if ( tunnelConfig ?. environment ) {
394+ tunnelArguments . environment = tunnelConfig . environment
395+ }
396+
397+
393398 ctx . log . debug ( `tunnel config ${ JSON . stringify ( tunnelArguments ) } ` )
394399
395400 if ( ctx . config . tunnel ?. type === 'auto' ) {
@@ -434,7 +439,7 @@ export async function startPollingForTunnel(ctx: Context, build_id: string, base
434439
435440 const status = await tunnelInstance . stop ( ) ;
436441 ctx . log . debug ( 'Tunnel is Stopped ? ' + status ) ;
437-
442+ return ;
438443 }
439444 } catch ( error : any ) {
440445 if ( error . message . includes ( 'ENOTFOUND' ) ) {
@@ -450,10 +455,10 @@ export async function startPollingForTunnel(ctx: Context, build_id: string, base
450455
451456export async function stopTunnelHelper ( ctx : Context ) {
452457 const tunnelRunningStatus = await tunnelInstance . isRunning ( ) ;
453- ctx . log . debug ( 'Running status of tunnel before stopping ? ' + tunnelRunningStatus ) ;
458+ ctx . log . debug ( 'stop-tunnel:: Running status of tunnel before stopping ? ' + tunnelRunningStatus ) ;
454459
455460 const status = await tunnelInstance . stop ( ) ;
456- ctx . log . debug ( 'Tunnel is Stopped ? ' + status ) ;
461+ ctx . log . debug ( 'stop-tunnel:: Tunnel is Stopped ? ' + status ) ;
457462}
458463
459464/**
0 commit comments