Skip to content
Closed
Changes from all commits
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
9 changes: 8 additions & 1 deletion ci3/source_redis
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,14 @@ function redis_cli {
}

function redis_setexz {
gzip | redis_cli -x SETEX $1 $2 &>/dev/null
if [ "$CI_REDIS_AVAILABLE" -eq 1 ]; then
gzip | redis_cli -x SETEX $1 $2 &>/dev/null
else
# redis_cli is a noop when redis is unavailable and never reads its stdin,
# so the upstream gzip in the pipe would get SIGPIPE and abort the caller
# under `set -o pipefail`. Drain stdin instead to keep this a clean noop.
cat >/dev/null
fi
}

function redis_getz {
Expand Down
Loading