restart apps on addon container change
when the IP changes on addon container re-create, the apps don't detect this (maybe there is some large DNS cache timeout in docker)
This commit is contained in:
@@ -164,7 +164,19 @@ function startApps(existingInfra, callback) {
|
||||
reverseProxy.removeAppConfigs(); // should we change the cert location, nginx will not start
|
||||
apps.configureInstalledApps(callback);
|
||||
} else {
|
||||
debug('startApps: apps are already uptodate');
|
||||
callback();
|
||||
let changedAddons = [];
|
||||
if (infra.images.mysql.tag !== existingInfra.images.mysql.tag) changedAddons.push('mysql');
|
||||
if (infra.images.postgresql.tag !== existingInfra.images.postgresql.tag) changedAddons.push('postgresql');
|
||||
if (infra.images.mongodb.tag !== existingInfra.images.mongodb.tag) changedAddons.push('mongodb');
|
||||
if (infra.images.redis.tag !== existingInfra.images.redis.tag) changedAddons.push('redis');
|
||||
|
||||
if (changedAddons.length) {
|
||||
// restart apps if docker image changes since the IP changes and any "persistent" connections fail
|
||||
debug(`startApps: changedAddons: ${JSON.stringify(changedAddons)}`);
|
||||
apps.restartAppsUsingAddons(changedAddons, callback);
|
||||
} else {
|
||||
debug('startApps: apps are already uptodate');
|
||||
callback();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user