From c1d23b18fbc7e57b4c47256260bdb5cd34a40631 Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Sun, 30 Nov 2025 12:18:47 -0600 Subject: [PATCH] refactor: streamline command and args handling in Redis container configuration - Updated the Redis container build function to simplify the handling of command and arguments. - Ensured default command and arguments are set when none are provided, improving robustness. --- packages/server/src/utils/databases/redis.ts | 22 +++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/packages/server/src/utils/databases/redis.ts b/packages/server/src/utils/databases/redis.ts index 78701c72d..4c7701726 100644 --- a/packages/server/src/utils/databases/redis.ts +++ b/packages/server/src/utils/databases/redis.ts @@ -73,14 +73,20 @@ export const buildRedis = async (redis: RedisNested) => { Mounts: [...volumesMount, ...bindsMount, ...filesMount], ...(StopGracePeriod !== null && StopGracePeriod !== undefined && { StopGracePeriod }), - ...(command && { - Command: command.split(" "), - }), - ...(args && - args.length > 0 && { - Args: args, - }), - + ...(command || args + ? { + ...(command && { + Command: command.split(" "), + }), + ...(args && + args.length > 0 && { + Args: args, + }), + } + : { + Command: ["/bin/sh"], + Args: ["-c", `redis-server --requirepass ${databasePassword}`], + }), Labels, }, Networks,