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:
Accusys
2026-08-08 17:35:23 +08:00
parent 8dada662e8
commit 8d83d9f217
9 changed files with 18 additions and 18 deletions
+6 -6
View File
@@ -261,7 +261,7 @@ async fn register_single_file(
};
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)
.ok()
@@ -512,7 +512,7 @@ async fn register_single_file(
let mut cut_done = false;
if has_video && total_frames > 0 && fps > 0.0 {
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")
.unwrap_or_else(|_| "/Users/accusys/momentry_core_0.1/scripts".to_string());
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 cut_path = std::path::Path::new(
&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));
let mut cut_count = 0i32;
@@ -612,7 +612,7 @@ async fn register_single_file(
if let Some(json_val) = probe_json {
let probe_path = std::path::Path::new(
&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));
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 output_dirs = [
config::OUTPUT_DIR.to_string(),
"/Users/accusys/momentry/output_dev".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;
// 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" {
"momentry_public_speaker"
} else {
+1 -1
View File
@@ -43,7 +43,7 @@ async fn create_identity(
State(_state): State<crate::api::types::AppState>,
Json(req): Json<CreateIdentityRequest>,
) -> 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 =
std::env::var("MOMENTRY_PYTHON_PATH").unwrap_or("/opt/homebrew/bin/python3.11".to_string());
+3 -3
View File
@@ -223,7 +223,7 @@ async fn trigger_processing(
}
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));
@@ -375,7 +375,7 @@ async fn download_json(
Path((file_uuid, processor)): Path<(String, String)>,
) -> Result<Json<serde_json::Value>, StatusCode> {
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 content = tokio::fs::read_to_string(&path)
.await
@@ -723,7 +723,7 @@ async fn get_processor_counts(
let file_uuid = full_uuid.ok_or(StatusCode::NOT_FOUND)?;
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 mut results = Vec::new();
+1 -1
View File
@@ -938,7 +938,7 @@ async fn get_file_stats(
}
// 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" {
"momentry_rule1".to_string()
} else {