Skip to content

Commit

Permalink
Cleaned up log message
Browse files Browse the repository at this point in the history
  • Loading branch information
vortarian committed Mar 16, 2017
1 parent e394718 commit 2e447db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/queues.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ module.exports = {
searchAndReplace(this.serverless.service, this.serverless.service.custom.sqs.queues);
},
remove() {
console.log("sqs-fifo.remove()");
let _this = this;
if(!sqs)
sqs = new aws.SQS({
Expand All @@ -118,18 +117,19 @@ console.log("sqs-fifo.remove()");
throw err;
})
.then((data) => {
console.log(`sqsRemoving queue ${JSON.stringify(data.QueueUrls, null, 2)}`);
// Delete the queue
for(var qu in data.QueueUrls) {
if(data.QueueUrls[qu].toString().endsWith(`/${queue.QueueName}`)) {
var queue = data.QueueUrls[qu];
if(queue.toString().endsWith(`/${queue.QueueName}`)) {
return sqs.deleteQueue({
'QueueUrl': data.QueueUrls[qu].toString()
'QueueUrl': queue.toString()
}).promise()
.catch((err) => {
_this.serverless.cli.log(`Error in removing queue: ${JSON.stringify(err, null, 2)}`);
throw err;
})
.then(() => {
_this.serverless.cli.log(`severless-sqs-queue Removed queue ${queue.url} for ${queue.logical_name}`);
_this.remove();
})
}
Expand Down

0 comments on commit 2e447db

Please sign in to comment.