-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworker_entrypoint.sh
More file actions
31 lines (22 loc) · 906 Bytes
/
Copy pathworker_entrypoint.sh
File metadata and controls
31 lines (22 loc) · 906 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
set -e
export PYTHONPATH=".:$(realpath /app)"
echo "PYTHONPATH set to: $PYTHONPATH"
cd /app/django_app
echo "Starting Celery Workers and Beat in one container..."
# Main worker: scan jobs
celery -A worker worker --loglevel=info --concurrency=2 -Q celery --hostname=scan_worker@%h &
scan_worker_pid=$!
# BugHound worker: fetch jobs (separate pool so fetches don't block scans)
celery -A worker worker --loglevel=info --concurrency=1 -Q bughound --hostname=bh_worker@%h &
bh_worker_pid=$!
# Watch Fresh worker: freshness scans, concurrency=1 to avoid stampeding
celery -A worker worker --loglevel=info --concurrency=1 -Q watch_fresh --hostname=wf_worker@%h &
wf_worker_pid=$!
celery -A worker beat --loglevel=info --scheduler django_celery_beat.schedulers:DatabaseScheduler &
beat_pid=$!
# Wait for all to exit
wait $scan_worker_pid
wait $bh_worker_pid
wait $wf_worker_pid
wait $beat_pid