feat: async insight generation with SQLite job tracking
- Add insight_generation_jobs table migration and DAO - Implement job lifecycle: create_or_get_active, complete, fail, cancel - Refactor POST /insights/generate and /agentic to async spawn with timeout - Add GET /insights/generation/status endpoint with job_id and file_path lookup - Use String for enum fields in Diesel models to avoid private Bound type - Add from_str() helpers on InsightJobStatus and InsightGenerationType - Fix update_training_messages to return Result<usize, DbError> - 7/7 DAO unit tests passing
This commit is contained in:
@@ -196,6 +196,12 @@ impl InsightGenerator {
|
||||
}
|
||||
}
|
||||
|
||||
/// Accessor for the insight DAO (used by async job completion to
|
||||
/// look up the stored insight id).
|
||||
pub fn insight_dao(&self) -> &Arc<Mutex<Box<dyn InsightDao>>> {
|
||||
&self.insight_dao
|
||||
}
|
||||
|
||||
/// Whether the optional Apollo Places integration is wired up. Drives
|
||||
/// tool-definition gating (no point offering `get_personal_place_at`
|
||||
/// when Apollo is unreachable) — exposed publicly so `insight_chat`
|
||||
|
||||
Reference in New Issue
Block a user