Skip to content

Commit 09aab99

Browse files
committed
o/p the error in healthcheck
1 parent 48b3fec commit 09aab99

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
#!/bin/sh
22
set -e
33
echo "${DATABASE_URL}"
4-
celery --config celeryconfig -A tasks worker -l INFO -P eventlet --concurrency ${CELERY_WORKER_CONCURRENCY:-1}
4+
celery --config celeryconfig -A tasks worker -l INFO -P eventlet --concurrency ${CELERY_WORKER_CONCURRENCY:-1} &
5+
6+
# Run the healthcheck script in the background
7+
./docker-healthcheck.sh &
8+
9+
# Wait for Celery worker to finish
10+
wait

request-processor/docker-healthcheck.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,20 @@
44
pgrep celery > /dev/null 2> /dev/null
55
exit_code=$?
66

7+
if [ $exit_code -eq 0 ]; then
8+
echo "Celery process is running"
9+
else
10+
echo "Celery process is NOT running"
11+
exit_code=1
12+
fi
13+
714
# Check SQS queue exists
8-
if aws sqs get-queue-url --queue-name celery > /dev/null 2> /dev/null
15+
if aws sqs get-queue-url --queue-name celery;
916
then
17+
echo "SQS Queue 'celery' is healthy and exists."
1018
sqs_status="HEALTHY"
1119
else
20+
echo "SQS Queue 'celery' is unhealthy or does not exists."
1221
sqs_status="UNHEALTHY";
1322
exit_code=1;
1423
fi
@@ -27,4 +36,4 @@ jq ".version=\"$GIT_COMMIT\" | (.dependencies[] | select(.name==\"request-db\"))
2736

2837
exit $exit_code
2938

30-
# Note use of > /dev/null 2> /dev/null which suppresses stout and stderr
39+
# Note use of > /dev/null 2> /dev/null which suppresses stout and stderr

0 commit comments

Comments
 (0)