From 78936a35c5e9491fa794e1eea68644f0cf23d58e Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Wed, 17 Oct 2018 10:33:39 -0700 Subject: [PATCH] redis: Check the new dump location first we do not cleanup the old dumps (yet). this then means that we will constantly be importing the older dump. --- src/addons.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/addons.js b/src/addons.js index 97b6c9127..78a0188a6 100644 --- a/src/addons.js +++ b/src/addons.js @@ -1372,11 +1372,11 @@ function restoreRedis(app, options, callback) { if (error) return callback(error); let input; - let oldDumpLocation = path.join(paths.APPS_DATA_DIR, app.id, 'redis/dump.rdb'); - if (fs.existsSync(oldDumpLocation)) { - input = fs.createReadStream(oldDumpLocation); - } else { - input = fs.createReadStream(path.join(paths.APPS_DATA_DIR, app.id, 'dump.rdb')); + const newDumpLocation = path.join(paths.APPS_DATA_DIR, app.id, 'dump.rdb'); + if (fs.existsSync(newDumpLocation)) { + input = fs.createReadStream(newDumpLocation); + } else { // old location of dumps + input = fs.createReadStream(path.join(paths.APPS_DATA_DIR, app.id, 'redis/dump.rdb')); } input.on('error', callback);