From cde4dabe42ec0a645fdd79c5d80db52199d5fd00 Mon Sep 17 00:00:00 2001 From: Michael Drury Date: Thu, 1 Jun 2023 11:10:39 +0100 Subject: [PATCH] Fixing some redis type errors. --- packages/server/package.json | 2 +- packages/server/src/integrations/redis.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 8e72a02b18..c73bba0f16 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -80,6 +80,7 @@ "global-agent": "3.0.0", "google-auth-library": "7.12.0", "google-spreadsheet": "3.2.0", + "ioredis": "5.3.2", "jimp": "0.16.1", "joi": "17.6.0", "js-yaml": "4.1.0", @@ -137,7 +138,6 @@ "@types/bson": "4.2.0", "@types/global-agent": "2.1.1", "@types/google-spreadsheet": "3.1.5", - "@types/ioredis": "4.28.10", "@types/jest": "29.5.0", "@types/koa": "2.13.4", "@types/koa__router": "8.0.8", diff --git a/packages/server/src/integrations/redis.ts b/packages/server/src/integrations/redis.ts index 26666ac800..a6372c8e13 100644 --- a/packages/server/src/integrations/redis.ts +++ b/packages/server/src/integrations/redis.ts @@ -177,7 +177,13 @@ class RedisIntegration { const pipeline = this.client.pipeline(pipelineCommands) const result = await pipeline.exec() - return result.map((output: string | string[]) => output[1]) + return result?.map((output: any) => { + if (typeof output === "string") { + return output + } else if (Array.isArray(output)) { + return output[1] + } + }) }) } }