mirror of
https://github.com/immich-app/immich.git
synced 2026-02-20 02:00:11 -05:00
fix(cli): suppress startup messages for immich-admin (#25928)
fix(server): suppress startup messages for immich-admin CLI Introduce a log_message() helper function with QUIET flag to suppress informational startup output when running immich-admin. This prevents both shell messages and Node.js WASI experimental warnings from interfering with CLI help output. Fixes: #25909
This commit is contained in:
parent
94e86c6e76
commit
491ed3d927
@ -1,5 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
echo "Initializing Immich $IMMICH_SOURCE_REF"
|
||||
|
||||
# Quiet mode suppresses informational output (enabled for immich-admin)
|
||||
QUIET=false
|
||||
if [ "$1" = "immich-admin" ]; then
|
||||
QUIET=true
|
||||
fi
|
||||
|
||||
# Helper function that only logs when not in quiet mode
|
||||
log_message() {
|
||||
if [ "$QUIET" = "false" ]; then
|
||||
echo "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
log_message "Initializing Immich $IMMICH_SOURCE_REF"
|
||||
|
||||
# TODO: Update to mimalloc v3 when verified memory isn't released issue is fixed
|
||||
# lib_path="/usr/lib/$(arch)-linux-gnu/libmimalloc.so.3"
|
||||
@ -30,16 +44,20 @@ read_file_and_export "DB_PASSWORD_FILE" "DB_PASSWORD"
|
||||
read_file_and_export "REDIS_PASSWORD_FILE" "REDIS_PASSWORD"
|
||||
|
||||
if CPU_CORES="${CPU_CORES:=$(get-cpus.sh 2>/dev/null)}"; then
|
||||
echo "Detected CPU Cores: $CPU_CORES"
|
||||
log_message "Detected CPU Cores: $CPU_CORES"
|
||||
if [ "$CPU_CORES" -gt 4 ]; then
|
||||
export UV_THREADPOOL_SIZE=$CPU_CORES
|
||||
fi
|
||||
else
|
||||
echo "skipping get-cpus.sh - not found in PATH or failed: using default UV_THREADPOOL_SIZE"
|
||||
log_message "skipping get-cpus.sh - not found in PATH or failed: using default UV_THREADPOOL_SIZE"
|
||||
fi
|
||||
|
||||
if [ -f "${SERVER_HOME}/dist/main.js" ]; then
|
||||
exec node "${SERVER_HOME}/dist/main.js" "$@"
|
||||
if [ "$QUIET" = "true" ]; then
|
||||
exec node --no-warnings "${SERVER_HOME}/dist/main.js" "$@"
|
||||
else
|
||||
exec node "${SERVER_HOME}/dist/main.js" "$@"
|
||||
fi
|
||||
else
|
||||
echo "Error: ${SERVER_HOME}/dist/main.js not found"
|
||||
if [ "$IMMICH_ENV" = "development" ]; then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user