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
11 lines (9 loc) • 336 B
JavaScript
const debug = require('debug')('rascal:tasks:checkQueues');
const _ = require('lodash');
module.exports = _.curry((config, ctx, next) => {
debug('Closing connection: %s', ctx.connectionConfig.loggableUrl);
if (!ctx.connection) return next(null, config, ctx);
ctx.connection.close((err) => {
next(err, config, ctx);
});
});