Source Code added
This commit is contained in:
parent
800376eafd
commit
9efa9bc6dd
3912 changed files with 754770 additions and 2 deletions
30
server/bin/immich-healthcheck
Executable file
30
server/bin/immich-healthcheck
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
log_container_verbose() {
|
||||
if [[ $IMMICH_LOG_LEVEL == verbose ]]; then
|
||||
echo "$1" > /proc/1/fd/2
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ ( $IMMICH_WORKERS_INCLUDE != '' && $IMMICH_WORKERS_INCLUDE != *api* ) || $IMMICH_WORKERS_EXCLUDE == *api* ]]; then
|
||||
echo "API worker excluded, skipping"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
IMMICH_HOST="${IMMICH_HOST:-localhost}"
|
||||
IMMICH_PORT="${IMMICH_PORT:-2283}"
|
||||
|
||||
result=$(curl -fsS -m 2 http://"$IMMICH_HOST":"$IMMICH_PORT"/api/server/ping)
|
||||
result_exit=$?
|
||||
|
||||
if [ $result_exit != 0 ]; then
|
||||
echo "Fail: exit code is $result_exit"
|
||||
log_container_verbose "Healthcheck failed: exit code $result_exit"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$result" != '{"res":"pong"}' ]; then
|
||||
echo "Fail: didn't reply with pong"
|
||||
log_container_verbose "Healthcheck failed: didn't reply with pong"
|
||||
exit 1
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue