1
0
mirror of https://github.com/docker/docs.git synced 2026-11-05 00:14:17 +03:00

Fixed starting/stopping apps locking up issue.

This commit is contained in:
Sean Li
2014-09-07 14:52:44 -07:00
parent aba0b291bc
commit a03f482d56
2 changed files with 14 additions and 11 deletions

View File

@@ -53,17 +53,20 @@ AppUtil.start = function (appId) {
Apps.update(app._id, {$set: {
status: 'STARTING'
}});
Docker.getContainerData(app.docker.Id, function (err, data) {
Docker.startContainer(app.docker.Id, function (err) {
if (err) { console.error(err); }
// Use dig to refresh the DNS
exec('/usr/bin/dig ' + app.name + '.kite @172.17.42.1', function(err, stdout, stderr) {
console.log(err);
console.log(stdout);
console.log(stderr);
Apps.update(app._id, {$set: {
status: 'READY',
docker: data
}});
Docker.getContainerData(app.docker.Id, function (err, data) {
if (err) { console.error(err); }
// Use dig to refresh the DNS
exec('/usr/bin/dig ' + app.name + '.kite @172.17.42.1', function(err, stdout, stderr) {
console.log(err);
console.log(stdout);
console.log(stderr);
Apps.update(app._id, {$set: {
status: 'READY',
docker: data
}});
});
});
});
}

View File

@@ -83,7 +83,7 @@ Docker.runContainer = function (app, image, callback) {
Docker.startContainer = function (containerId, callback) {
var container = docker.getContainer(containerId);
container.stop(function (err) {
container.start(function (err) {
if (err) {
console.log(err);
callback(err);