From 61e1d3246d3848ea3059b42e7fbaa14e1f5d8cc4 Mon Sep 17 00:00:00 2001 From: Marco Pedone Date: Mon, 4 Aug 2025 19:39:43 +0200 Subject: [PATCH] Update SKIP_REDIS environment variable handling to use string comparison --- apps/infoalloggi/Dockerfile | 4 ++-- apps/infoalloggi/src/env.mjs | 2 +- apps/infoalloggi/src/pages/api/tiles/[[...slug]].ts | 2 +- apps/infoalloggi/src/utils/keydb.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/infoalloggi/Dockerfile b/apps/infoalloggi/Dockerfile index 6a82b6e..23d037d 100644 --- a/apps/infoalloggi/Dockerfile +++ b/apps/infoalloggi/Dockerfile @@ -62,7 +62,7 @@ ENV KEYDB_URL=$KEYDB_URL ARG TILES_URL ENV TILES_URL=$TILES_URL ENV NEXT_TELEMETRY_DISABLED=1 -ENV SKIP_REDIS=1 +ENV SKIP_REDIS="true" RUN SKIP_ENV_VALIDATION=1 npm run build @@ -118,7 +118,7 @@ ENV KEYDB_URL=$KEYDB_URL ARG TILES_URL ENV TILES_URL=$TILES_URL ENV NEXT_TELEMETRY_DISABLED=1 -ENV SKIP_REDIS=0 +ENV SKIP_REDIS="false" RUN addgroup -g 1001 -S nodejs RUN adduser -S nextjs -u 1001 diff --git a/apps/infoalloggi/src/env.mjs b/apps/infoalloggi/src/env.mjs index a46cff9..7d5de74 100644 --- a/apps/infoalloggi/src/env.mjs +++ b/apps/infoalloggi/src/env.mjs @@ -29,7 +29,7 @@ const server = z.object({ TILES_URL: z.string(), KEYDB_URL: z.string(), JWT_SECRET: z.string(), - SKIP_REDIS: z.coerce.boolean(), + SKIP_REDIS: z.string(), }); /** diff --git a/apps/infoalloggi/src/pages/api/tiles/[[...slug]].ts b/apps/infoalloggi/src/pages/api/tiles/[[...slug]].ts index a5fd5f0..5557ff9 100644 --- a/apps/infoalloggi/src/pages/api/tiles/[[...slug]].ts +++ b/apps/infoalloggi/src/pages/api/tiles/[[...slug]].ts @@ -5,7 +5,7 @@ import { env } from "~/env.mjs"; let tiles: Redis | null = null; export function getTilesClient() { - if (env.SKIP_REDIS) { + if (env.SKIP_REDIS === "true") { return null; } if (!tiles) { diff --git a/apps/infoalloggi/src/utils/keydb.ts b/apps/infoalloggi/src/utils/keydb.ts index 8ce66ee..5457efe 100644 --- a/apps/infoalloggi/src/utils/keydb.ts +++ b/apps/infoalloggi/src/utils/keydb.ts @@ -4,7 +4,7 @@ import { env } from "~/env.mjs"; let keydb: Redis | null = null; export function getKeydbClient() { - if (env.SKIP_REDIS) { + if (env.SKIP_REDIS === "true") { return null; } if (!keydb) {