Skip to content

Commit

Permalink
fix: shut down sauce connect properly
Browse files Browse the repository at this point in the history
Closes #5
  • Loading branch information
johanneswuerbach authored and vojtajina committed Jul 17, 2013
1 parent e31123f commit 17f94f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ var SauceConnect = function(emitter, logger) {

alreadyRunningDefered = q.defer();
launchSauceConnect(options, function(err, p) {
if (onKilled) {
return onKilled();
}

alreadyRunningProces = p;
alreadyRunningDefered.resolve();
});
Expand All @@ -46,8 +42,7 @@ var SauceConnect = function(emitter, logger) {
emitter.on('exit', function(done) {
if (alreadyRunningProces) {
log.info('Shutting down Sauce Connect');
onKilled = done;
alreadyRunningProces.close();
alreadyRunningProces.close(done);
} else {
done();
}
Expand Down Expand Up @@ -103,7 +98,7 @@ var SauceLabsBrowser = function(id, args, sauceConnect, /* config.sauceLabs */ c
'build': args.build || config.build || process.env.TRAVIS_BUILD_NUMBER ||
process.env.BUILD_NUMBER || process.env.BUILD_TAG ||
process.env.CIRCLE_BUILD_NUM || null

};

url = url + '?id=' + id;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"author": "Vojta Jina <vojta.jina@gmail.com>",
"dependencies": {
"wd": "~0.0.32",
"sauce-connect-launcher": "~0.1.5",
"sauce-connect-launcher": "~0.1.10",
"q": "~0.9.6"
},
"peerDependencies": {
Expand Down

0 comments on commit 17f94f8

Please sign in to comment.