2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-12-23 02:28:57 +00:00

feat: ping additional services using doctor

handle error
docs entry for health check command
This commit is contained in:
Revant Nandgaonkar 2020-07-02 13:40:23 +05:30
parent 6dfb1de5c6
commit 5648e3a6c4
2 changed files with 22 additions and 1 deletions

View File

@ -32,9 +32,18 @@ def main():
print("Redis Queue Connected")
check_redis_socketio(retry=1, delay=0, print_attempt=False)
print("Redis SocketIO Connected")
if(args.ping_services):
for service in args.ping_services:
service_name, service_port = service.split(':')
service_name = None
service_port = None
try:
service_name, service_port = service.split(':')
except ValueError:
print('Service should be in format host:port, e.g postgres:5432')
exit(1)
check_service(
retry=1,
delay=0,

View File

@ -189,3 +189,15 @@ docker run \
```
Instead of `alpine` use any image of your choice.
## Health check
For socketio and gunicorn service ping the hostname:port and that will be sufficient. For workers and scheduler, there is a command that needs to be executed.
```shell
docker exec -it <project-name>_erpnext-worker-d \
docker-entrypoint.sh doctor -p postgresql-master.pgsql.svc.cluster.local:5432
```
This check ensures that given service should be connected along with services in common_site_config.json.
If connection to service(s) fails, the command fails with exit code 1.