redis/index.js
function createClient(testRedisUrl) {
  const redisUrl = testRedisUrl || REDIS_URL;

  if (!redisUrl) {
    return bluebird.reject(new Error('No Redis URL set'));
  }

  log('debug', `Connecting to Redis at ${redisUrl}`);

  return new bluebird(resolve => {
    module.exports.client = bluebird.promisifyAll(new Redis(redisUrl));
    module.exports.client.on('error', logGenericError(__filename));

    resolve({ server: redisUrl });
  });
}
function createClient(testRedisUrl) {
  const redisUrl = testRedisUrl || REDIS_URL;

  if (!redisUrl) {
    return bluebird.reject(new Error('No Redis URL set'));
  }

  log('debug', `Connecting to Redis at ${redisUrl}`);

  return new bluebird(resolve => {
    module.exports.client = bluebird.promisifyAll(new Redis(redisUrl));
    module.exports.client.on('error', logGenericError(__filename));

    resolve({ server: redisUrl });
  });
}
function createClient ( testRedisUrl ) { const redisUrl = testRedisUrl || REDIS_URL ; if ( ! redisUrl ) { return bluebird . reject ( new Error ( 'No Redis URL set' ) ) ; } log ( 'debug' , ` ${ redisUrl } ` ) ; return new bluebird ( resolve => { module . exports . client = bluebird . promisifyAll ( new Redis ( redisUrl ) ) ; module . exports . client . on ( 'error' , logGenericError ( __filename ) ) ; resolve ( { server : redisUrl } ) ; } ) ; }
Connect to Redis and store the client

@param {String} testRedisUrl, used for testing only
@return {Promise}
Connect to Redis and store the client