PromucFlow_constructor/deploy/docker/fs/opt/appsmith/auto_heal.sh
Goutham Pratapa 64cd315262
chore: Remove extra unneeded sleep in auto heal script (#29422)
<!-- 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 -->
2023-12-07 15:10:50 +05:30

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