lydgs commited on
Commit
d068948
·
verified ·
1 Parent(s): b4ad2f5

Update start.sh

Browse files
Files changed (1) hide show
  1. start.sh +6 -13
start.sh CHANGED
@@ -1,18 +1,11 @@
1
  #!/bin/bash
2
  set -e
3
 
4
- # 启动 supervisor 到后台(不阻塞)
5
- /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf &
6
 
7
- # 等待数据库文件出现(最多等待10秒)
8
- for i in {1..10}; do
9
- if [ -f "/app/server/data/freeapi.db" ]; then
10
- echo "Database file detected, running restore..."
11
- python3 /app/scripts/restore_from_dataset.py
12
- break
13
- fi
14
- sleep 1
15
- done
16
 
17
- # 保持前台进程
18
- wait
 
1
  #!/bin/bash
2
  set -e
3
 
4
+ echo "==> Running database restore..."
5
+ python3 /app/scripts/restore_from_dataset.py
6
 
7
+ echo "==> Syncing Bailian models (first boot)..."
8
+ python3 /app/scripts/sync_bailian_models.py || echo "Warning: model sync failed, will retry later via cron"
 
 
 
 
 
 
 
9
 
10
+ echo "==> Starting supervisor..."
11
+ exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf