UNPKG

rascal

Version:

A config driven wrapper for amqplib supporting multi-host connections, automatic error recovery, redelivery flood protection, transparent encryption / decryption, channel pooling and publication timeouts

22 lines (19 loc) 571 B
const debug = require('debug')('rascal:tasks:checkQueues'); const _ = require('lodash'); const async = require('async'); module.exports = _.curry((config, ctx, next) => { async.eachSeries( _.keys(config.queues), (name, callback) => { checkQueue(ctx.channel, config.queues[name], callback); }, (err) => { next(err, config, ctx); } ); }); function checkQueue(channel, config, next) { if (!config.check) return next(); debug('Checking queue: %s', config.fullyQualifiedName); channel.checkQueue(config.fullyQualifiedName, next); }