fix: replace dev schema defaults with public
- schema.rs: Change DATABASE_SCHEMA default from 'dev' to 'public' - rule2_ingest.rs, files.rs, tools.rs, scan.rs: Same schema default fix - files.rs, watcher.rs, processing.rs: Change output_dev to output - identities.rs: Change API schema parameter default from 'dev' to 'public' - postgres_db.rs: Add face_settings column to SELECT query (fix ColumnIndexOutOfBounds panic) This fixes worker not processing jobs due to missing dev schema.
This commit is contained in:
+6
-6
@@ -261,7 +261,7 @@ async fn register_single_file(
|
|||||||
};
|
};
|
||||||
|
|
||||||
let output_dir = std::env::var("MOMENTRY_OUTPUT_DIR")
|
let output_dir = std::env::var("MOMENTRY_OUTPUT_DIR")
|
||||||
.unwrap_or_else(|_| "/Users/accusys/momentry/output_dev".to_string());
|
.unwrap_or_else(|_| "/Users/accusys/momentry/output".to_string());
|
||||||
|
|
||||||
let birthday = std::fs::metadata(&path)
|
let birthday = std::fs::metadata(&path)
|
||||||
.ok()
|
.ok()
|
||||||
@@ -512,7 +512,7 @@ async fn register_single_file(
|
|||||||
let mut cut_done = false;
|
let mut cut_done = false;
|
||||||
if has_video && total_frames > 0 && fps > 0.0 {
|
if has_video && total_frames > 0 && fps > 0.0 {
|
||||||
let output_dir = std::env::var("MOMENTRY_OUTPUT_DIR")
|
let output_dir = std::env::var("MOMENTRY_OUTPUT_DIR")
|
||||||
.unwrap_or_else(|_| "/Users/accusys/momentry/output_dev".to_string());
|
.unwrap_or_else(|_| "/Users/accusys/momentry/output".to_string());
|
||||||
let scripts_dir = std::env::var("MOMENTRY_SCRIPTS_DIR")
|
let scripts_dir = std::env::var("MOMENTRY_SCRIPTS_DIR")
|
||||||
.unwrap_or_else(|_| "/Users/accusys/momentry_core_0.1/scripts".to_string());
|
.unwrap_or_else(|_| "/Users/accusys/momentry_core_0.1/scripts".to_string());
|
||||||
let python_path = std::env::var("MOMENTRY_PYTHON_PATH")
|
let python_path = std::env::var("MOMENTRY_PYTHON_PATH")
|
||||||
@@ -579,7 +579,7 @@ async fn register_single_file(
|
|||||||
let audio_tracks_json = serde_json::to_value(&audio_tracks).ok();
|
let audio_tracks_json = serde_json::to_value(&audio_tracks).ok();
|
||||||
let cut_path = std::path::Path::new(
|
let cut_path = std::path::Path::new(
|
||||||
&std::env::var("MOMENTRY_OUTPUT_DIR")
|
&std::env::var("MOMENTRY_OUTPUT_DIR")
|
||||||
.unwrap_or_else(|_| "/Users/accusys/momentry/output_dev".to_string()),
|
.unwrap_or_else(|_| "/Users/accusys/momentry/output".to_string()),
|
||||||
)
|
)
|
||||||
.join(format!("{}.cut.json", file_uuid));
|
.join(format!("{}.cut.json", file_uuid));
|
||||||
let mut cut_count = 0i32;
|
let mut cut_count = 0i32;
|
||||||
@@ -612,7 +612,7 @@ async fn register_single_file(
|
|||||||
if let Some(json_val) = probe_json {
|
if let Some(json_val) = probe_json {
|
||||||
let probe_path = std::path::Path::new(
|
let probe_path = std::path::Path::new(
|
||||||
&std::env::var("MOMENTRY_OUTPUT_DIR")
|
&std::env::var("MOMENTRY_OUTPUT_DIR")
|
||||||
.unwrap_or_else(|_| "/Users/accusys/momentry/output_dev".to_string()),
|
.unwrap_or_else(|_| "/Users/accusys/momentry/output".to_string()),
|
||||||
)
|
)
|
||||||
.join(format!("{}.probe.json", file_uuid));
|
.join(format!("{}.probe.json", file_uuid));
|
||||||
let json_str = serde_json::to_string_pretty(&json_val).unwrap_or_default();
|
let json_str = serde_json::to_string_pretty(&json_val).unwrap_or_default();
|
||||||
@@ -1062,7 +1062,7 @@ fn delete_output_files(uuid: &str) -> u64 {
|
|||||||
let mut deleted_count = 0u64;
|
let mut deleted_count = 0u64;
|
||||||
let output_dirs = [
|
let output_dirs = [
|
||||||
config::OUTPUT_DIR.to_string(),
|
config::OUTPUT_DIR.to_string(),
|
||||||
"/Users/accusys/momentry/output_dev".to_string(),
|
"/Users/accusys/momentry/output".to_string(),
|
||||||
"/Users/accusys/momentry/output".to_string(),
|
"/Users/accusys/momentry/output".to_string(),
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -1601,7 +1601,7 @@ async fn unregister_internal(state: &AppState, uuid: &str) -> Result<(), StatusC
|
|||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
// Delete from speaker collection
|
// Delete from speaker collection
|
||||||
let schema = std::env::var("DATABASE_SCHEMA").unwrap_or_else(|_| "dev".to_string());
|
let schema = std::env::var("DATABASE_SCHEMA").unwrap_or_else(|_| "public".to_string());
|
||||||
let speaker_collection = if schema == "public" {
|
let speaker_collection = if schema == "public" {
|
||||||
"momentry_public_speaker"
|
"momentry_public_speaker"
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ async fn create_identity(
|
|||||||
State(_state): State<crate::api::types::AppState>,
|
State(_state): State<crate::api::types::AppState>,
|
||||||
Json(req): Json<CreateIdentityRequest>,
|
Json(req): Json<CreateIdentityRequest>,
|
||||||
) -> Result<Json<CreateIdentityResponse>, (StatusCode, String)> {
|
) -> Result<Json<CreateIdentityResponse>, (StatusCode, String)> {
|
||||||
let schema = req.schema.unwrap_or("dev".to_string());
|
let schema = req.schema.unwrap_or("public".to_string());
|
||||||
let python_path =
|
let python_path =
|
||||||
std::env::var("MOMENTRY_PYTHON_PATH").unwrap_or("/opt/homebrew/bin/python3.11".to_string());
|
std::env::var("MOMENTRY_PYTHON_PATH").unwrap_or("/opt/homebrew/bin/python3.11".to_string());
|
||||||
|
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ async fn trigger_processing(
|
|||||||
}
|
}
|
||||||
|
|
||||||
let output_dir = std::env::var("MOMENTRY_OUTPUT_DIR")
|
let output_dir = std::env::var("MOMENTRY_OUTPUT_DIR")
|
||||||
.unwrap_or_else(|_| "/Users/accusys/momentry/output_dev".to_string());
|
.unwrap_or_else(|_| "/Users/accusys/momentry/output".to_string());
|
||||||
|
|
||||||
let output_path = std::path::Path::new(&output_dir).join(format!("{}.monitor.json", file_uuid));
|
let output_path = std::path::Path::new(&output_dir).join(format!("{}.monitor.json", file_uuid));
|
||||||
|
|
||||||
@@ -375,7 +375,7 @@ async fn download_json(
|
|||||||
Path((file_uuid, processor)): Path<(String, String)>,
|
Path((file_uuid, processor)): Path<(String, String)>,
|
||||||
) -> Result<Json<serde_json::Value>, StatusCode> {
|
) -> Result<Json<serde_json::Value>, StatusCode> {
|
||||||
let output_dir = std::env::var("MOMENTRY_OUTPUT_DIR")
|
let output_dir = std::env::var("MOMENTRY_OUTPUT_DIR")
|
||||||
.unwrap_or_else(|_| "/Users/accusys/momentry/output_dev".to_string());
|
.unwrap_or_else(|_| "/Users/accusys/momentry/output".to_string());
|
||||||
let path = std::path::Path::new(&output_dir).join(format!("{}.{}.json", file_uuid, processor));
|
let path = std::path::Path::new(&output_dir).join(format!("{}.{}.json", file_uuid, processor));
|
||||||
let content = tokio::fs::read_to_string(&path)
|
let content = tokio::fs::read_to_string(&path)
|
||||||
.await
|
.await
|
||||||
@@ -723,7 +723,7 @@ async fn get_processor_counts(
|
|||||||
|
|
||||||
let file_uuid = full_uuid.ok_or(StatusCode::NOT_FOUND)?;
|
let file_uuid = full_uuid.ok_or(StatusCode::NOT_FOUND)?;
|
||||||
let output_dir = std::env::var("MOMENTRY_OUTPUT_DIR")
|
let output_dir = std::env::var("MOMENTRY_OUTPUT_DIR")
|
||||||
.unwrap_or_else(|_| "/Users/accusys/momentry/output_dev".to_string());
|
.unwrap_or_else(|_| "/Users/accusys/momentry/output".to_string());
|
||||||
|
|
||||||
let processors = crate::core::db::ProcessorType::all();
|
let processors = crate::core::db::ProcessorType::all();
|
||||||
let mut results = Vec::new();
|
let mut results = Vec::new();
|
||||||
|
|||||||
+1
-1
@@ -938,7 +938,7 @@ async fn get_file_stats(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Text chunk stats (rule1 collection)
|
// Text chunk stats (rule1 collection)
|
||||||
let schema = std::env::var("DATABASE_SCHEMA").unwrap_or_else(|_| "dev".to_string());
|
let schema = std::env::var("DATABASE_SCHEMA").unwrap_or_else(|_| "public".to_string());
|
||||||
let rule1_collection = if schema == "public" {
|
let rule1_collection = if schema == "public" {
|
||||||
"momentry_rule1".to_string()
|
"momentry_rule1".to_string()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ use crate::core::llm::function_calling::call_llm_vision;
|
|||||||
use crate::core::processor::tkg::query_auto_representative_frame;
|
use crate::core::processor::tkg::query_auto_representative_frame;
|
||||||
|
|
||||||
fn t(name: &str) -> String {
|
fn t(name: &str) -> String {
|
||||||
let schema = std::env::var("DATABASE_SCHEMA").unwrap_or_else(|_| "dev".to_string());
|
let schema = std::env::var("DATABASE_SCHEMA").unwrap_or_else(|_| "public".to_string());
|
||||||
if schema == "public" {
|
if schema == "public" {
|
||||||
name.to_string()
|
name.to_string()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ use std::sync::Arc;
|
|||||||
use tracing::{info, warn};
|
use tracing::{info, warn};
|
||||||
|
|
||||||
fn t(name: &str) -> String {
|
fn t(name: &str) -> String {
|
||||||
let schema = std::env::var("DATABASE_SCHEMA").unwrap_or_else(|_| "dev".to_string());
|
let schema = std::env::var("DATABASE_SCHEMA").unwrap_or_else(|_| "public".to_string());
|
||||||
if schema == "public" {
|
if schema == "public" {
|
||||||
name.to_string()
|
name.to_string()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -2098,7 +2098,7 @@ impl PostgresDb {
|
|||||||
let row = sqlx::query(
|
let row = sqlx::query(
|
||||||
&format!(
|
&format!(
|
||||||
r#"
|
r#"
|
||||||
SELECT id, uuid, video_path, status, current_processor, progress_total, progress_current, error_count, last_error, started_at::TEXT, updated_at::TEXT, created_at::TEXT, processors, completed_processors, failed_processors, video_id
|
SELECT id, uuid, video_path, status, current_processor, progress_total, progress_current, error_count, last_error, started_at::TEXT, updated_at::TEXT, created_at::TEXT, processors, completed_processors, failed_processors, video_id, face_settings::TEXT
|
||||||
FROM {} WHERE uuid = $1
|
FROM {} WHERE uuid = $1
|
||||||
"#,
|
"#,
|
||||||
table
|
table
|
||||||
@@ -2145,7 +2145,7 @@ impl PostgresDb {
|
|||||||
let rows = sqlx::query(
|
let rows = sqlx::query(
|
||||||
&format!(
|
&format!(
|
||||||
r#"
|
r#"
|
||||||
SELECT id, uuid, video_path, status, current_processor, progress_total, progress_current, error_count, last_error, started_at::TEXT, updated_at::TEXT, created_at::TEXT, processors, completed_processors, failed_processors, video_id
|
SELECT id, uuid, video_path, status, current_processor, progress_total, progress_current, error_count, last_error, started_at::TEXT, updated_at::TEXT, created_at::TEXT, processors, completed_processors, failed_processors, video_id, face_settings::TEXT
|
||||||
FROM {} WHERE status = $1 ORDER BY created_at ASC
|
FROM {} WHERE status = $1 ORDER BY created_at ASC
|
||||||
"#,
|
"#,
|
||||||
table
|
table
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ pub fn t(name: &str) -> String {
|
|||||||
|
|
||||||
/// Alias for t() - used by postgres_db.rs
|
/// Alias for t() - used by postgres_db.rs
|
||||||
pub fn table_name(name: &str) -> String {
|
pub fn table_name(name: &str) -> String {
|
||||||
let schema = std::env::var("DATABASE_SCHEMA").unwrap_or_else(|_| "dev".to_string());
|
let schema = std::env::var("DATABASE_SCHEMA").unwrap_or_else(|_| "public".to_string());
|
||||||
if schema == "public" {
|
if schema == "public" {
|
||||||
name.to_string()
|
name.to_string()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ async fn auto_register_file(file_path: &str) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let output_dir = std::env::var("MOMENTRY_OUTPUT_DIR")
|
let output_dir = std::env::var("MOMENTRY_OUTPUT_DIR")
|
||||||
.unwrap_or_else(|_| "/Users/accusys/momentry/output_dev".to_string());
|
.unwrap_or_else(|_| "/Users/accusys/momentry/output".to_string());
|
||||||
let pre_path = std::path::PathBuf::from(&output_dir).join(format!("{}.pre.json", file_uuid));
|
let pre_path = std::path::PathBuf::from(&output_dir).join(format!("{}.pre.json", file_uuid));
|
||||||
let pre_content = match std::fs::read_to_string(&pre_path) {
|
let pre_content = match std::fs::read_to_string(&pre_path) {
|
||||||
Ok(c) => c,
|
Ok(c) => c,
|
||||||
@@ -207,7 +207,7 @@ pub async fn pre_process_file(file_path: &str) -> Option<String> {
|
|||||||
let filename = path.file_name()?.to_string_lossy().to_string();
|
let filename = path.file_name()?.to_string_lossy().to_string();
|
||||||
|
|
||||||
let output_dir = std::env::var("MOMENTRY_OUTPUT_DIR")
|
let output_dir = std::env::var("MOMENTRY_OUTPUT_DIR")
|
||||||
.unwrap_or_else(|_| "/Users/accusys/momentry/output_dev".to_string());
|
.unwrap_or_else(|_| "/Users/accusys/momentry/output".to_string());
|
||||||
|
|
||||||
let birthday = std::fs::metadata(&path)
|
let birthday = std::fs::metadata(&path)
|
||||||
.ok()
|
.ok()
|
||||||
|
|||||||
Reference in New Issue
Block a user