feat(node): adding all in one node support
This commit is contained in:
27
resources/node/files/scripts/liveness-local.sh
Normal file
27
resources/node/files/scripts/liveness-local.sh
Normal file
@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
ping_valkey() {
|
||||
resp=$(timeout -s 15 $1 \
|
||||
valkey-cli \
|
||||
-h localhost \
|
||||
-p $VALKEY_PORT \
|
||||
ping)
|
||||
ret=${?}
|
||||
echo $resp
|
||||
return ${ret}
|
||||
}
|
||||
|
||||
response=$(ping_valkey 5)
|
||||
if [ "$?" -eq "124" ]; then
|
||||
echo "Timed out"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
firstWord=$(echo $response | awk 'NR==1 {print $1;}')
|
||||
if [ "$response" != "PONG" ] && [ "$firstWord" != "LOADING" ] && [ "$firstWord" != "MASTERDOWN" ]; then
|
||||
echo "Valey is not alive [${response}]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "$( date +'[%Y/%m/%d %H:%M:%S]') Valkey is alive"
|
||||
exit 0
|
Reference in New Issue
Block a user