Fixing logic for upgrading

This commit is contained in:
Chris Cowan 2015-03-02 15:22:58 -07:00
parent b7fbf305fd
commit 5d3438d738

View file

@ -9,6 +9,9 @@ module.exports = function (response) {
// nothing needs to be done
if (response.hits.hits.length === 0) return Promise.resolve();
// if we already have a the current version in the index then we need to stop
if (_.find(response.hits.hits, { _id: config.package.version })) return Promise.resolve();
// Look for upgradeable configs. If none of them are upgradeable
// then resolve with null.
var body = _.find(response.hits.hits, isUpgradeable);