File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,19 @@ worker() {
22
22
exec supervisord -c worker.conf
23
23
}
24
24
25
+ workers_healthcheck () {
26
+ WORKERS_COUNT=${WORKERS_COUNT}
27
+ echo " Checking active workers count against $WORKERS_COUNT ..."
28
+ ACTIVE_WORKERS_COUNT=` echo $( rq info --url $REDASH_REDIS_URL -R | grep workers | grep -oP ^[0-9]+) `
29
+ if [ " $ACTIVE_WORKERS_COUNT " < " $WORKERS_COUNT " ]; then
30
+ echo " $ACTIVE_WORKERS_COUNT workers are active, Exiting"
31
+ exit 1
32
+ else
33
+ echo " $ACTIVE_WORKERS_COUNT workers are active"
34
+ exit 0
35
+ fi
36
+ }
37
+
25
38
dev_worker () {
26
39
echo " Starting dev RQ worker..."
27
40
@@ -76,6 +89,10 @@ case "$1" in
76
89
shift
77
90
worker
78
91
;;
92
+ workers_healthcheck)
93
+ shift
94
+ workers_healthcheck
95
+ ;;
79
96
server)
80
97
shift
81
98
server
You can’t perform that action at this time.
0 commit comments