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 } }) + }) } /**