Socket
Socket
Sign inDemoInstall

catbox-redis

Package Overview
Dependencies
Maintainers
5
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

catbox-redis - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2

7

lib/index.js

@@ -47,3 +47,8 @@

if (this.settings.url) {
if (this.settings.sentinels && this.settings.sentinels.length) {
options.sentinels = this.settings.sentinels;
options.name = this.settings.sentinelName;
client = Redis.createClient(options);
}
else if (this.settings.url) {
client = Redis.createClient(this.settings.url, options);

@@ -50,0 +55,0 @@ }

2

package.json
{
"name": "catbox-redis",
"description": "Redis adapter for catbox",
"version": "3.0.1",
"version": "3.0.2",
"author": "Eran Hammer <eran@hammer.io> (http://hueniverse.com)",

@@ -6,0 +6,0 @@ "contributors": [

@@ -17,2 +17,4 @@ catbox-redis [![Build Status](https://travis-ci.org/hapijs/catbox-redis.svg?branch=master)](https://travis-ci.org/hapijs/catbox-redis)

- `partition` - this will store items under keys that start with this value. (Default: '')
- `sentinels` - an array of redis sentinel addresses to connect to.
- `sentinelName` - the name of the sentinel master. (Only needed when `sentinels` is specified)

@@ -19,0 +21,0 @@ ## Tests

@@ -11,2 +11,3 @@

const RedisClient = require('ioredis');
const EventEmitter = require('events').EventEmitter;

@@ -25,2 +26,4 @@

const it = lab.test;
const before = lab.before;
const after = lab.after;

@@ -537,2 +540,57 @@

describe('', () => {
const oldCreateClient = RedisClient.createClient;
before((done) => {
RedisClient.createClient = function (opts) {
const out = new EventEmitter();
process.nextTick(() => {
out.emit('ready');
out.removeAllListeners();
});
out.callArgs = opts;
return out;
};
done();
});
after((done) => {
RedisClient.createClient = oldCreateClient;
done();
});
it('connects to a sentinel cluster.', (done) => {
const options = {
sentinels: [
{
host: '127.0.0.1',
port: 26379
},
{
host: '127.0.0.2',
port: 26379
}
],
sentinelName: 'mymaster'
};
const redis = new Redis(options);
redis.start((err) => {
expect(err).to.not.exist();
const client = redis.client;
expect(client).to.exist();
expect(client.callArgs.sentinels).to.equal(options.sentinels);
expect(client.callArgs.name).to.equal(options.sentinelName);
done();
});
});
});
it('does not stops the client on error post connection', (done) => {

@@ -539,0 +597,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc