-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·34 lines (27 loc) · 1001 Bytes
/
Copy pathstart.sh
File metadata and controls
executable file
·34 lines (27 loc) · 1001 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
32
33
34
#!/usr/bin/env bash
set -e
DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$DIR"
# Kill any existing processes on port 8090
lsof -ti :8090 2>/dev/null | xargs kill -9 2>/dev/null || true
# Kill existing daemon
[ -f .daemon.pid ] && kill $(cat .daemon.pid) 2>/dev/null || true
[ -f .api.pid ] && kill $(cat .api.pid) 2>/dev/null || true
sleep 1
# Clear stale bytecode
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete 2>/dev/null || true
# Reset viewed_at so issues never vanish
.venv/bin/python -c "
from db.store import init_db, get_connection; init_db()
with get_connection() as c:
c.execute('UPDATE issues SET viewed_at = NULL')
" 2>/dev/null || true
echo "Starting daemon..."
nohup .venv/bin/python -m daemon.main > /dev/null 2>&1 &
echo $! > .daemon.pid
echo "Starting API server..."
nohup .venv/bin/uvicorn api.main:app --host 0.0.0.0 --port 8090 > /dev/null 2>&1 &
echo $! > .api.pid
sleep 2
echo "Ready at http://localhost:8090"