diff --git a/README.md b/README.md index a58bf85e..44c20268 100644 --- a/README.md +++ b/README.md @@ -261,10 +261,14 @@ You can also pass redis client directly. ```javascript // assume you already initialized redis client before +// the "redis" key can be IORedis.Redis or IORedis.Cluster instance var redisClient = new Redis(); var connectionDetails = { redis: redisClient }; +var redisCluster = new Cluster(); +var connectionDetails = { redis: redisCluster }; + var worker = new NodeResque.Worker( { connection: connectionDetails, queues: "math" }, jobs diff --git a/src/core/connection.ts b/src/core/connection.ts index 36fe689e..e2bf6568 100644 --- a/src/core/connection.ts +++ b/src/core/connection.ts @@ -12,7 +12,7 @@ export class Connection extends EventEmitter { options: ConnectionOptions | null; private eventListeners: EventListeners; connected: boolean; - redis: IORedis.Redis; + redis: IORedis.Redis | IORedis.Cluster; constructor(options: ConnectionOptions = {}) { super(); diff --git a/src/types/options.ts b/src/types/options.ts index fa9987b2..0eb9b773 100644 --- a/src/types/options.ts +++ b/src/types/options.ts @@ -10,7 +10,7 @@ export interface ConnectionOptions { namespace?: string; looping?: boolean; options?: any; - redis?: IORedis.Redis; + redis?: IORedis.Redis | IORedis.Cluster; scanCount?: number; }