From 8073ccf5e55241ed3ec2f11a8408db3416f5aa58 Mon Sep 17 00:00:00 2001 From: Nathan219 Date: Wed, 5 Jul 2017 16:22:40 -0700 Subject: [PATCH] Need to fetch the AICs for multi --- lib/models/rabbitmq/index.js | 2 +- lib/models/services/cluster-config-service.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/models/rabbitmq/index.js b/lib/models/rabbitmq/index.js index eeb287d9b..d32285a66 100644 --- a/lib/models/rabbitmq/index.js +++ b/lib/models/rabbitmq/index.js @@ -271,7 +271,7 @@ RabbitMQ.prototype.createCluster = function (data) { } RabbitMQ.prototype.deleteCluster = function (data) { - this._publisher.publishTask('cluster.delete', data) + return this._publisher.publishTask('cluster.delete', data) } RabbitMQ.prototype.updateCluster = function (data) { diff --git a/lib/models/services/cluster-config-service.js b/lib/models/services/cluster-config-service.js index dd5f210c5..36db07748 100644 --- a/lib/models/services/cluster-config-service.js +++ b/lib/models/services/cluster-config-service.js @@ -425,7 +425,10 @@ module.exports = class ClusterConfigService { }) log.info('called') return ClusterConfigService.findAllRelatedClusters(clusterId) - .each((cluster) => rabbitMQ.deleteCluster(cluster)) + .map((cluster) => AutoIsolationConfig.findByIdAndAssert(cluster.autoIsolationConfigId)) + .each((cluster) => { + return rabbitMQ.deleteCluster({ cluster: { id: cluster.id } }) + }) } /**