File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
set -e
3
3
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
Original file line number Diff line number Diff line change 4
4
pgrep celery > /dev/null 2> /dev/null
5
5
exit_code=$?
6
6
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
+
7
14
# 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;
9
16
then
17
+ echo " SQS Queue 'celery' is healthy and exists."
10
18
sqs_status=" HEALTHY"
11
19
else
20
+ echo " SQS Queue 'celery' is unhealthy or does not exists."
12
21
sqs_status=" UNHEALTHY" ;
13
22
exit_code=1;
14
23
fi
@@ -27,4 +36,4 @@ jq ".version=\"$GIT_COMMIT\" | (.dependencies[] | select(.name==\"request-db\"))
27
36
28
37
exit $exit_code
29
38
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
You can’t perform that action at this time.
0 commit comments