Implement file information processing queue system and Vector Graph preperation

This commit is contained in:
Christbru 2025-10-19 05:02:01 -05:00
commit 381b7b8858
9 changed files with 350 additions and 36 deletions

View file

@ -1,3 +1,4 @@
mod file_worker;
mod api;
mod db;
mod gemini_client;
@ -31,10 +32,14 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Initialize DB
let pool = db::init_db(&database_url).await.map_err(|e| -> Box<dyn Error> { Box::new(e) })?;
// Spawn worker
// Spawn query worker
let worker = worker::Worker::new(pool.clone());
tokio::spawn(async move { worker.run().await });
// Spawn file analysis worker
let file_worker = file_worker::FileWorker::new(pool.clone());
tokio::spawn(async move { file_worker.run().await });
// API routes
let api_routes = api::routes(pool.clone())
.with(warp::cors()