How to use the redis-commands.list.push function in redis-commands

To help you get started, we’ve selected a few redis-commands examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github contentacms / contentajs / src / caching / Cache.js View on Github external
// @flow

import type { Pool } from 'generic-pool';
import type { GenericPoolOptions } from '../../flow/types/generic-pool';

const _ = require('lodash');
const Redis = require('ioredis');
const { createPool } = require('generic-pool');
let commands: Array = require('redis-commands').list;

// Make some alterations to the list of commands.
commands = _.difference(commands, ['monitor']);
commands.push('sentinel');

/**
 * Interacts with the Redis cache via a connection pool transparently.
 */
class Cache {
  /**
   * The pool of connections.
   */
  pool: Pool;

  /**
   * Constructs a cache object.
   *
   * @param {string} redisHost
   *   The redis host with the redis:// form.
   * @param {Object} redisOptions