<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Chores** - Optimized auto-healing script by removing an unnecessary 60-second delay. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
24 lines
674 B
Bash
Executable File
24 lines
674 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
set -o xtrace
|
|
|
|
sleep 120
|
|
|
|
while true;
|
|
do
|
|
### Get backend state
|
|
echo "auto heal check"
|
|
appsmith_status="$(curl --write-out %{http_code} --silent --output /dev/null localhost:80/api/v1/tenants/current)"
|
|
echo "TIMESTAMP=`date "+%Y-%m-%d %H:%M:%S"` backend response "$appsmith_status
|
|
if [[ "$appsmith_status" -ne 200 ]];
|
|
then
|
|
echo "TIMESTAMP=`date "+%Y-%m-%d %H:%M:%S"` backend is unresponsive";
|
|
supervisorctl restart backend || echo true
|
|
else
|
|
echo "TIMESTAMP=`date "+%Y-%m-%d %H:%M:%S"` backend is responsive";
|
|
fi
|
|
sleep 10
|
|
done
|