feat: schema tracking, SHA256 integrity, identity UUID fix, 3-angle face match, cuts table, trace stranger_id
This commit is contained in:
35
src/main.rs
35
src/main.rs
@@ -9,12 +9,20 @@ use clap::Parser;
|
||||
mod cli;
|
||||
mod processing;
|
||||
|
||||
fn init_tracing() {
|
||||
tracing_subscriber::fmt()
|
||||
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
|
||||
.with_target(true)
|
||||
.init();
|
||||
}
|
||||
|
||||
use cli::*;
|
||||
use processing::handlers::*;
|
||||
|
||||
/// Main entry point
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
init_tracing();
|
||||
let cli = Cli::parse();
|
||||
|
||||
match cli.command {
|
||||
@@ -207,12 +215,37 @@ async fn handle_worker(
|
||||
poll_interval: Option<u64>,
|
||||
batch_size: Option<i32>,
|
||||
) -> Result<()> {
|
||||
use momentry_core::core::db::{Database, PostgresDb, RedisClient};
|
||||
use momentry_core::worker::{JobWorker, WorkerConfig};
|
||||
|
||||
println!("Starting job worker");
|
||||
println!("Max concurrent: {:?}", max_concurrent);
|
||||
println!("Poll interval: {:?}", poll_interval);
|
||||
println!("Batch size: {:?}", batch_size);
|
||||
|
||||
// TODO: Implement worker logic
|
||||
let config = WorkerConfig {
|
||||
max_concurrent: max_concurrent.unwrap_or(2),
|
||||
poll_interval_secs: poll_interval.unwrap_or(5),
|
||||
enabled: true,
|
||||
batch_size: batch_size.unwrap_or(10),
|
||||
processor_timeout_secs: 3600,
|
||||
};
|
||||
|
||||
let db = PostgresDb::init().await?;
|
||||
let redis = RedisClient::new()?;
|
||||
|
||||
let worker = JobWorker::new(
|
||||
std::sync::Arc::new(db),
|
||||
std::sync::Arc::new(redis),
|
||||
config.clone(),
|
||||
);
|
||||
|
||||
println!(
|
||||
"Starting worker with max_concurrent={}, poll_interval={}s",
|
||||
config.max_concurrent, config.poll_interval_secs
|
||||
);
|
||||
|
||||
worker.run().await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user