From c703c008f063af816cd46fa5e3d5bd4307b4bab2 Mon Sep 17 00:00:00 2001 From: Evan Tahler Date: Mon, 7 Aug 2023 10:33:32 -0700 Subject: [PATCH] fix RedisMock detection (#974) --- src/core/scheduler.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/scheduler.ts b/src/core/scheduler.ts index 91f0b864..237cbb12 100644 --- a/src/core/scheduler.ts +++ b/src/core/scheduler.ts @@ -315,7 +315,13 @@ export class Scheduler extends EventEmitter { } private canWatch() { - if (this.connection.redis?.constructor?.name === "RedisMock") return false; + if ( + ["RedisMock", "_RedisMock"].includes( + this.connection.redis?.constructor?.name, + ) + ) { + return false; + } if (typeof this.connection.redis.unwatch !== "function") return false; return true; }