Skip to content

Commit b76cf61

Browse files
committed
optimise code
1 parent fbd0e2b commit b76cf61

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

src/commander/server.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import createBuildExec from '../tasks/createBuildExec.js';
99
import snapshotQueue from '../lib/snapshotQueue.js';
1010
import { startPolling, startPingPolling } from '../lib/utils.js';
1111
import startTunnel from '../tasks/startTunnel.js'
12-
const util = require('util');
1312

1413
const command = new Command();
1514

@@ -61,7 +60,6 @@ command
6160
startPolling(ctx, '', false, '')
6261
}
6362

64-
6563
} catch (error) {
6664
console.error('Error during server execution:', error);
6765
process.exit(1);

src/lib/snapshotQueue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ export default class Queue {
380380
useKafkaFlow: resp.data.useKafkaFlow || false,
381381
}
382382
} else {
383-
if (this.ctx.config.tunnel && this.ctx.config.tunnel?.type === 'auto') {
383+
if (this.ctx.autoTunnelStarted) {
384384
await stopTunnelHelper(this.ctx)
385385
}
386386
throw new Error('SmartUI capabilities are missing in env variables or in driver capabilities');

src/tasks/createBuildExec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default (ctx: Context): ListrTask<Context, ListrRendererFactory, ListrRen
4444
task.title = 'Skipped SmartUI build creation'
4545
}
4646

47-
if (ctx.config.tunnel && ctx.config.tunnel?.type === 'auto') {
47+
if (ctx.autoTunnelStarted) {
4848
if (ctx.build && ctx.build.id && ctx.sourceCommand != "exec-start") {
4949
startPingPolling(ctx);
5050
}
@@ -80,7 +80,7 @@ export default (ctx: Context): ListrTask<Context, ListrRendererFactory, ListrRen
8080
}
8181
} catch (error: any) {
8282
ctx.log.debug(error);
83-
if (ctx.config.tunnel && ctx.config.tunnel?.type === 'auto') {
83+
if (ctx.autoTunnelStarted) {
8484
await stopTunnelHelper(ctx)
8585
}
8686
task.output = chalk.gray(error.message);

0 commit comments

Comments
 (0)