imaginary: improve healthcheck and start.sh (#7949)

This commit is contained in:
Simon L.
2026-04-20 13:40:19 +02:00
committed by GitHub
2 changed files with 8 additions and 5 deletions

View File

@@ -1,3 +1,3 @@
#!/bin/bash
nc -z 127.0.0.1 "$PORT" || exit 1
wget -q -O /dev/null "http://127.0.0.1:${PORT}/health" || exit 1

View File

@@ -1,8 +1,11 @@
#!/bin/bash
echo "Imaginary has started"
if [ -z "$IMAGINARY_SECRET" ]; then
imaginary -return-size -max-allowed-resolution 222.2 "$@"
else
imaginary -return-size -max-allowed-resolution 222.2 -key "$IMAGINARY_SECRET" "$@"
IMAGINARY_ARGS=(-return-size -max-allowed-resolution 222.2)
if [ -n "$IMAGINARY_SECRET" ]; then
IMAGINARY_ARGS+=(-key "$IMAGINARY_SECRET")
fi
imaginary "${IMAGINARY_ARGS[@]}" "$@"