KarlQuant commited on
Commit
bcf61a1
·
verified ·
1 Parent(s): 7a3f62e

Update entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +10 -8
entrypoint.sh CHANGED
@@ -10,18 +10,20 @@ echo "=== QUASAR entrypoint: cleaning up stale state ==="
10
  # Kill any lingering supervisord from a previous run
11
  pkill -f supervisord 2>/dev/null || true
12
 
13
- # Kill any lingering hub/ranker Python processes
14
- pkill -f websocket_hub.py 2>/dev/null || true
15
- pkill -f Quasar_axrvi_ranker.py 2>/dev/null || true
 
16
 
17
- # Give OS a moment to release sockets
18
- sleep 1
19
 
20
- # Remove stale PID files
21
  rm -f /tmp/supervisord.pid
 
22
 
23
  # Confirm our app files exist (catches missing-file issues early)
24
- for f in /app/websocket_hub.py /app/Quasar_axrvi_ranker.py; do
25
  if [ ! -f "$f" ]; then
26
  echo "ERROR: Required file missing: $f"
27
  echo "Make sure it is committed to your HF Space repository."
@@ -30,4 +32,4 @@ for f in /app/websocket_hub.py /app/Quasar_axrvi_ranker.py; do
30
  done
31
 
32
  echo "=== Starting supervisord ==="
33
- exec /usr/bin/supervisord -c /etc/supervisord.conf
 
10
  # Kill any lingering supervisord from a previous run
11
  pkill -f supervisord 2>/dev/null || true
12
 
13
+ # Kill any lingering hub/ranker/dashboard Python processes
14
+ pkill -f websocket_hub.py 2>/dev/null || true
15
+ pkill -f Quasar_axrvi_ranker.py 2>/dev/null || true
16
+ pkill -f hub_dashboard_service.py 2>/dev/null || true
17
 
18
+ # Give OS enough time to fully release sockets (7860, 8051, etc.)
19
+ sleep 3
20
 
21
+ # Remove stale PID and socket files
22
  rm -f /tmp/supervisord.pid
23
+ rm -f /tmp/supervisor.sock
24
 
25
  # Confirm our app files exist (catches missing-file issues early)
26
+ for f in /app/websocket_hub.py /app/Quasar_axrvi_ranker.py /app/hub_dashboard_service.py; do
27
  if [ ! -f "$f" ]; then
28
  echo "ERROR: Required file missing: $f"
29
  echo "Make sure it is committed to your HF Space repository."
 
32
  done
33
 
34
  echo "=== Starting supervisord ==="
35
+ exec /usr/bin/supervisord -c /etc/supervisord.conf