mirror of
https://github.com/samsonjs/immich.git
synced 2026-04-27 15:07:45 +00: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 changed files with 22 additions and 4 deletions
|
|
@ -1,5 +1,19 @@
|
||||||
#!/usr/bin/env bash
|
#!/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
|
# TODO: Update to mimalloc v3 when verified memory isn't released issue is fixed
|
||||||
# lib_path="/usr/lib/$(arch)-linux-gnu/libmimalloc.so.3"
|
# 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"
|
read_file_and_export "REDIS_PASSWORD_FILE" "REDIS_PASSWORD"
|
||||||
|
|
||||||
if CPU_CORES="${CPU_CORES:=$(get-cpus.sh 2>/dev/null)}"; then
|
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
|
if [ "$CPU_CORES" -gt 4 ]; then
|
||||||
export UV_THREADPOOL_SIZE=$CPU_CORES
|
export UV_THREADPOOL_SIZE=$CPU_CORES
|
||||||
fi
|
fi
|
||||||
else
|
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
|
fi
|
||||||
|
|
||||||
if [ -f "${SERVER_HOME}/dist/main.js" ]; then
|
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
|
else
|
||||||
echo "Error: ${SERVER_HOME}/dist/main.js not found"
|
echo "Error: ${SERVER_HOME}/dist/main.js not found"
|
||||||
if [ "$IMMICH_ENV" = "development" ]; then
|
if [ "$IMMICH_ENV" = "development" ]; then
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue