Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[fix] Only start an app when activating a snapshot
Fixes #320.
  • Loading branch information
mmalecki committed Sep 26, 2012
1 parent c7486f8 commit 1b84a91
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
12 changes: 7 additions & 5 deletions lib/jitsu/commands/snapshots.js
Expand Up @@ -231,11 +231,13 @@ snapshots.activate = function (name, callback) {
// Remark: After activating a snapshot, we immediately stop && start it,
// as to update the running version of the snapshot
//
jitsu.commands.stop(name, function() {
jitsu.commands.start(name, function() {
jitsu.log.info('Snapshot ' + snapshot.id.magenta + ' is now running');
callback(null);
});
jitsu.commands.start(name, function (err) {
if (err) {
return callback(err);
}

jitsu.log.info('Snapshot ' + snapshot.id.magenta + ' is now running');
callback();
});
});
});
Expand Down
8 changes: 0 additions & 8 deletions test/commands/snapshots-test.js
Expand Up @@ -84,8 +84,6 @@ vows.describe('jitsu/commands/snapshots').addBatch({
}, { 'x-powered-by': 'Nodejitsu' })
.post('/apps/tester/application2/snapshots/0.0.0-1/activate', {})
.reply(200, '', { 'x-powered-by': 'Nodejitsu' })
.post('/apps/tester/application2/stop', {})
.reply(200, '', { 'x-powered-by': 'Nodejitsu' })
.post('/apps/tester/application2/start', {})
.reply(200, '', { 'x-powered-by': 'Nodejitsu' })
.get('/apps/tester/application2', '')
Expand All @@ -107,8 +105,6 @@ vows.describe('jitsu/commands/snapshots').addBatch({
}, { 'x-powered-by': 'Nodejitsu' })
.post('/apps/tester/application2/snapshots/0.0.0-1/activate', {})
.reply(200, '', { 'x-powered-by': 'Nodejitsu' })
.post('/apps/tester/application2/stop', {})
.reply(200, '', { 'x-powered-by': 'Nodejitsu' })
.post('/apps/tester/application2/start', {})
.reply(200, '', { 'x-powered-by': 'Nodejitsu' })
.get('/apps/tester/application2', '')
Expand All @@ -135,8 +131,6 @@ vows.describe('jitsu/commands/snapshots').addBatch({
}, { 'x-powered-by': 'Nodejitsu' })
.post('/apps/tester/application2/snapshots/0.0.0-1/activate', {})
.reply(200, '', { 'x-powered-by': 'Nodejitsu' })
.post('/apps/tester/application2/stop', {})
.reply(200, '', { 'x-powered-by': 'Nodejitsu' })
.post('/apps/tester/application2/start', {})
.reply(200, '', { 'x-powered-by': 'Nodejitsu' })
.get('/apps/tester/application2', '')
Expand Down Expand Up @@ -222,8 +216,6 @@ vows.describe('jitsu/commands/snapshots').addBatch({
}, { 'x-powered-by': 'Nodejitsu' })
.post('/apps/tester/example-app/snapshots/0.0.0-1/activate', {})
.reply(200, '', { 'x-powered-by': 'Nodejitsu' })
.post('/apps/tester/example-app/stop', {})
.reply(200, '', { 'x-powered-by': 'Nodejitsu' })
.post('/apps/tester/example-app/start', {})
.reply(200, '', { 'x-powered-by': 'Nodejitsu' })
.get('/apps/tester/example-app', '')
Expand Down

0 comments on commit 1b84a91

Please sign in to comment.