Skip to content

Commit c24aaa3

Browse files
Merge pull request #70 from japneetlambdatest/master
Tunnel Stop Async handling
2 parents a8f9619 + 304b530 commit c24aaa3

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

commands/run.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,19 @@ module.exports = function (args) {
7575
.run_batches(lt_config, batches, env)
7676
.then(function (exit_code) {
7777
console.log("stopping tunnel");
78-
tunnelInstance.stop();
79-
if (
80-
lt_config["run_settings"]["exit-on-failure"]
81-
) {
82-
process.exit(exit_code);
83-
}
78+
tunnelInstance.stop().then(function (done) {
79+
if (
80+
lt_config["run_settings"]["exit-on-failure"]
81+
) {
82+
process.exit(exit_code);
83+
}
84+
});
85+
})
86+
.catch(function (error) {
87+
console.log(
88+
"Error occured while stopping tunnel"
89+
);
90+
console.log(error);
8491
})
8592
.catch(function (error) {
8693
console.log("stopping tunnel failed");

0 commit comments

Comments
 (0)