fix: admin server must use shared assets.db — stale local copy caused 'asset not found'
Root cause: Admin server's DB_PATH defaulted to its own assets.db (local copy with 7,560 assets) instead of the main app's DB (10,148 assets). Machine ID 68026 didn't exist in the stale copy. Fix: - Copied main app's assets.db over (now synced) - Set CANTEEN_DB_PATH in run.sh to default to ../canteen-asset-tracker/assets.db (env var can still override for custom setups)
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
# Run the admin server — uses same DB as main canteen-asset-tracker
|
||||
# CANTEEN_DB_PATH defaults to ../canteen-asset-tracker/assets.db
|
||||
# Run the admin server — MUST use same DB as main canteen-asset-tracker
|
||||
set -euo pipefail
|
||||
|
||||
PORT="${PORT:-8090}"
|
||||
HOST="${HOST:-0.0.0.0}"
|
||||
APP_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
CANTEEN_DB_PATH="${CANTEEN_DB_PATH:-${APP_DIR}/../canteen-asset-tracker/assets.db}"
|
||||
|
||||
export CANTEEN_DB_PATH
|
||||
|
||||
exec python -m uvicorn admin_server:app \
|
||||
--host "$HOST" \
|
||||
|
||||
Reference in New Issue
Block a user