chore: Redis config don't write to filesystem at runtime (#26788)

Step towards not changing anything in the filesystem at runtime, except
for things in `/tmp`.
This commit is contained in:
Shrikant Sharat Kandula 2023-09-05 12:38:51 +05:30 committed by GitHub
parent f8752fd9ea
commit fae3a4e7c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 12 deletions

View File

@ -295,14 +295,7 @@ configure_supervisord() {
fi fi
if [[ $APPSMITH_REDIS_URL == *"localhost"* || $APPSMITH_REDIS_URL == *"127.0.0.1"* ]]; then if [[ $APPSMITH_REDIS_URL == *"localhost"* || $APPSMITH_REDIS_URL == *"127.0.0.1"* ]]; then
cp "$SUPERVISORD_CONF_PATH/redis.conf" /etc/supervisor/conf.d/ cp "$SUPERVISORD_CONF_PATH/redis.conf" /etc/supervisor/conf.d/
# Initialize Redis rdb directory mkdir -p "$stacks_path/data/redis"
local redis_db_path="$stacks_path/data/redis"
mkdir -p "$redis_db_path"
# Enable saving Redis session data to disk more often, so recent sessions aren't cleared on restart.
sed -i \
-e 's/^save 60 10000$/save 15 1/g' \
-e "s|^dir /var/lib/redis$|dir ${redis_db_path}|g" \
/etc/redis/redis.conf
fi fi
if ! [[ -e "/appsmith-stacks/ssl/fullchain.pem" ]] || ! [[ -e "/appsmith-stacks/ssl/privkey.pem" ]]; then if ! [[ -e "/appsmith-stacks/ssl/fullchain.pem" ]] || ! [[ -e "/appsmith-stacks/ssl/privkey.pem" ]]; then
cp "$SUPERVISORD_CONF_PATH/cron.conf" /etc/supervisor/conf.d/ cp "$SUPERVISORD_CONF_PATH/cron.conf" /etc/supervisor/conf.d/

View File

@ -1,8 +1,8 @@
[program:redis] [program:redis]
directory=/etc/redis directory=/etc/redis
; The empty string is used to force Redis to log to stdout ; The `--save` is for saving session data to disk more often, so recent sessions aren't cleared on restart.
; so that supervisor can capture it ; The empty string to `--logfile` is for logging to stdout so that supervisor can capture it.
command=redis-server redis.conf --daemonize no --logfile "" command=redis-server --save 15 1 --dir /appsmith-stacks/data/redis --daemonize no --logfile ""
priority=5 priority=5
autostart=true autostart=true
autorestart=true autorestart=true