Add a timeout to wait for redis to start

This commit is contained in:
Girish Ramakrishnan
2018-09-17 20:40:07 -07:00
parent 1b205ac107
commit 3fcf6aa339
+3 -1
View File
@@ -981,9 +981,11 @@ function setupRedis(app, options, callback) {
shell.execSync.bind(null, 'stopRedis', `docker stop --time=10 ${redisName} 2>/dev/null || true`),
shell.execSync.bind(null, 'stopRedis', `docker rm --volumes ${redisName} 2>/dev/null || true`),
shell.execSync.bind(null, 'startRedis', cmd),
appdb.setAddonConfig.bind(null, app.id, 'redis', env)
appdb.setAddonConfig.bind(null, app.id, 'redis', env),
function (next) { setTimeout(next, 5000); } // TODO: waitForRedis?
], function (error) {
if (error) debug('Error setting up redis: ', error);
callback(error);
});
});