1.8 KiB
Convert Watchdog And Integration API Plan
For agent: REQUIRED SUB-SKILL: Use Section 4 or Section 5 to implement this plan. Goal: Add self-healing for stuck local conversion jobs, expose a read-only integration API for other internal sites, and finish the server path migration to
/home/inspur/tools/document-cleaningwithout leaving old deployment paths behind. Architecture: Extend the existing watchdog service into a shared health/recovery layer for both sync and convert jobs, then wire the host watchdog script to observe the local RQ queue and restart the local worker when it stalls. Add a separate token-protected integration router that exposes knowledge-base, file, version, and download relationships without direct database access. Tech Stack: FastAPI, SQLAlchemy, Redis/RQ, Vue (existing UI untouched for this task), Docker Compose, host-side watchdog Python script.
Scope
- Local convert stale detection and recovery
- Host watchdog extension for local RQ queue / worker recovery
- Token-protected external read-only API
- Server cron/path updates from old project root to
/home/inspur/tools/document-cleaning - Verification on both local tests and deployed server
Non-Goals
- PostgreSQL storage relocation
- New UI surfaces for convert watchdog
- Multi-tenant API key management
Task Outline
- Add convert health summary and stale-recovery services plus tests.
- Extend watchdog CLI and host watchdog script to monitor the local convert queue and restart the app worker when it stalls.
- Add integration API settings, auth dependency, endpoints, and tests.
- Sync the latest code to
/home/inspur/tools/document-cleaning, update cron/default paths, and remove old deployment paths. - Run local tests, rebuild the server, and verify the new endpoints and watchdog behavior.