release: v1.3.1 - Pipeline Queue Integration, OCR Fix, Worker Compatibility
Major Changes: - Pipeline Queue integration completed (internal.file + pipeline.commands) - Fixed old job_worker database compatibility with new command_queue table - Compiled Swift OCR binary (was missing, causing empty OCR results) - Added deep scan functionality through re-scan API Fixes: - Changed CommandJob.id from i32 to i64 for database compatibility - Added UUID generation in create_command (message_id field) - Fixed claim_pending_commands to query queue_name = 'internal.file' - Fixed field mappings: command_id → message_id, job_type → command_type - Added support for 'processing' status in CommandJobStatus Queue System: - internal.file queue: for register/unregister/re-scan commands (job_worker) - pipeline.commands queue: for vectorize/store_asrx/etc commands (pipeline_worker) Documentation: - Added comprehensive queue system documentation - Created M4 workspace status reports - Updated AGENTS.md with queue system details
This commit is contained in:
+38
-9
@@ -19,7 +19,7 @@ fn init_tracing() {
|
||||
|
||||
fn load_env() {
|
||||
// Resolve .env at runtime so the binary is portable across machines.
|
||||
// Order: MOMENTRY_ENV_FILE -> ./.env -> <exe_dir>/../../.env
|
||||
// Order: MOMENTRY_ENV_FILE -> ./.env -> <install_root>/config/.env -> <install_root>/.env -> $HOME/.env
|
||||
if let Ok(p) = std::env::var("MOMENTRY_ENV_FILE") {
|
||||
let _ = dotenv::from_filename(p);
|
||||
return;
|
||||
@@ -28,8 +28,29 @@ fn load_env() {
|
||||
return;
|
||||
}
|
||||
if let Ok(exe) = std::env::current_exe() {
|
||||
if let Some(root) = exe.parent().and_then(|p| p.parent()).and_then(|p| p.parent()) {
|
||||
let _ = dotenv::from_filename(root.join(".env"));
|
||||
// <install>/bin/momentry -> <install>
|
||||
if let Some(install_root) = exe
|
||||
.parent()
|
||||
.and_then(|p| p.parent())
|
||||
{
|
||||
// Package installs .env at <install>/config/.env
|
||||
let config_env = install_root.join("config").join(".env");
|
||||
if config_env.exists() {
|
||||
let _ = dotenv::from_filename(&config_env);
|
||||
return;
|
||||
}
|
||||
// Fallback: <install>/.env
|
||||
if dotenv::from_filename(install_root.join(".env")).is_ok() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Legacy fallback: $HOME/.env
|
||||
if let Some(home) = exe
|
||||
.parent()
|
||||
.and_then(|p| p.parent())
|
||||
.and_then(|p| p.parent())
|
||||
{
|
||||
let _ = dotenv::from_filename(home.join(".env"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -133,6 +154,16 @@ async fn main() -> Result<()> {
|
||||
Commands::Agent { tool, args } => {
|
||||
cli::agent::handle_agent(&tool, &args).await?;
|
||||
}
|
||||
Commands::Init { skip_db, skip_deps, force, scan_dir, quiet } => {
|
||||
let opts = momentry_core::core::init::InitOptions {
|
||||
skip_db,
|
||||
skip_deps,
|
||||
force,
|
||||
scan_dir: scan_dir.map(std::path::PathBuf::from),
|
||||
quiet,
|
||||
};
|
||||
momentry_core::core::init::run(opts).await?;
|
||||
}
|
||||
Commands::Detect {
|
||||
image,
|
||||
objects,
|
||||
@@ -151,11 +182,11 @@ async fn main() -> Result<()> {
|
||||
|
||||
/// Handle register command
|
||||
async fn handle_register(path: &str) -> Result<()> {
|
||||
use momentry_core::core::db::postgres_db::StorageStatus;
|
||||
use momentry_core::core::db::{Database, PostgresDb, VideoRecord, VideoStatus};
|
||||
use momentry_core::core::probe::probe_video;
|
||||
use std::path::Path;
|
||||
use uuid::Uuid;
|
||||
use momentry_core::core::probe::probe_video;
|
||||
use momentry_core::core::db::{Database, PostgresDb, VideoRecord, VideoStatus};
|
||||
use momentry_core::core::db::postgres_db::StorageStatus;
|
||||
|
||||
println!("Registering video: {}", path);
|
||||
|
||||
@@ -361,7 +392,7 @@ async fn handle_worker(
|
||||
|
||||
let db = PostgresDb::init().await?;
|
||||
let redis = RedisClient::new()?;
|
||||
|
||||
|
||||
// Run migrations on worker startup
|
||||
println!("Running database migrations...");
|
||||
PostgresDb::run_migrations(db.pool()).await?;
|
||||
@@ -434,8 +465,6 @@ async fn handle_backup(action: &str, days: Option<u32>) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// Handle Gitea command
|
||||
async fn handle_gitea(
|
||||
action: GiteaAction,
|
||||
|
||||
Reference in New Issue
Block a user