-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_workers.sh
More file actions
executable file
·31 lines (23 loc) · 825 Bytes
/
run_workers.sh
File metadata and controls
executable file
·31 lines (23 loc) · 825 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
#!/usr/bin/env bash
set -e
cd "$(dirname "$0")"
echo "[1/5] Loading env..."
set -a
source .env
set +a
mkdir -p logs
echo "[2/5] Starting Sentinel API on 127.0.0.1:8001..."
nohup ./venv/bin/uvicorn sentinel_api:app --host 127.0.0.1 --port 8001 > logs/api.log 2>&1 &
sleep 1
echo "[3/5] Starting Manager..."
nohup ./venv/bin/python worker_manager.py > logs/manager.log 2>&1 &
echo "[4/5] Starting Writer/Email/Twitter..."
nohup ./venv/bin/python worker_writer.py > logs/writer.log 2>&1 &
nohup ./venv/bin/python worker_email.py > logs/email.log 2>&1 &
nohup ./venv/bin/python worker_twitter.py > logs/twitter.log 2>&1 &
echo "[5/5] DONE. Tail logs with:"
echo " tail -f logs/api.log"
echo " tail -f logs/manager.log"
echo " tail -f logs/writer.log"
echo " tail -f logs/email.log"
echo " tail -f logs/twitter.log"