Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "Shutdowns"
This reverts commit b66597a.
  • Loading branch information
Telesphoreo committed May 18, 2026
commit 5edd286cba5200006b39edf418c4fa04b52b8179
18 changes: 5 additions & 13 deletions redis/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ echo ":/home/container$ ${MODIFIED_STARTUP}"
eval ${MODIFIED_STARTUP} &
REDIS_PID=$!

shutdown() {
/usr/local/bin/redis-cli -p "${SERVER_PORT}" -a "${SERVER_PASSWORD}" --no-auth-warning SHUTDOWN NOSAVE 2>/dev/null
wait $REDIS_PID 2>/dev/null
exit 0
}
trap shutdown TERM INT
trap 'kill -TERM $REDIS_PID 2>/dev/null; wait $REDIS_PID; exit' TERM INT

for i in $(seq 1 60); do
if /usr/local/bin/redis-cli -p "${SERVER_PORT}" -a "${SERVER_PASSWORD}" --no-auth-warning PING 2>/dev/null | grep -q PONG; then
Expand All @@ -24,12 +19,9 @@ for i in $(seq 1 60); do
sleep 0.5
done

(
while IFS= read -r line; do
[ -z "$line" ] && continue
printf '%s\n' "$line" | /usr/local/bin/redis-cli -p "${SERVER_PORT}" -a "${SERVER_PASSWORD}" --no-auth-warning
done
) &
READER_PID=$!
while IFS= read -r line; do
[ -z "$line" ] && continue
printf '%s\n' "$line" | /usr/local/bin/redis-cli -p "${SERVER_PORT}" -a "${SERVER_PASSWORD}" --no-auth-warning
done

wait $REDIS_PID