feat: real service test endpoints (proxy 7-route round-trip, core/chat/vlm/markbase/embedding), unified log paths + errorLog, pipeline tools/import/export/folder APIs, face pipeline check, dynamic concurrency tuning
This commit is contained in:
@@ -219,6 +219,40 @@ pub fn get_scene_vlm_config() -> (bool, u32, usize, bool, usize) {
|
||||
|
||||
pub static OUTPUT_DIR: Lazy<String> = Lazy::new(|| crate::core::admin_config::get_output_dir());
|
||||
|
||||
/// Get the per-library output directory for a file based on its upload_path
|
||||
pub async fn get_output_dir_for_file(file_uuid: &str, pool: &sqlx::PgPool) -> String {
|
||||
let videos_table = crate::core::db::schema::table_name("videos");
|
||||
let upload_paths_table = crate::core::db::schema::table_name("upload_paths");
|
||||
|
||||
let result: Option<(Option<String>,)> = sqlx::query_as(
|
||||
&format!(
|
||||
"SELECT up.output_path FROM {} v
|
||||
LEFT JOIN {} up ON v.file_path LIKE up.full_path || '%%'
|
||||
WHERE v.file_uuid = $1
|
||||
AND up.output_path IS NOT NULL AND up.output_path != ''
|
||||
LIMIT 1",
|
||||
videos_table, upload_paths_table
|
||||
)
|
||||
)
|
||||
.bind(file_uuid)
|
||||
.fetch_optional(pool)
|
||||
.await
|
||||
.ok()
|
||||
.flatten();
|
||||
|
||||
if let Some((Some(output_path),)) = result {
|
||||
return output_path;
|
||||
}
|
||||
|
||||
OUTPUT_DIR.to_string()
|
||||
}
|
||||
|
||||
pub fn get_output_dir_for_file_sync(_file_uuid: &str, _pool: &sqlx::PgPool) -> String {
|
||||
// Sync context cannot easily query DB - use global OUTPUT_DIR
|
||||
// Use async version `get_output_dir_for_file()` for proper per-library paths
|
||||
OUTPUT_DIR.to_string()
|
||||
}
|
||||
|
||||
pub static BACKUP_DIR: Lazy<String> = Lazy::new(|| crate::core::admin_config::get_backup_dir());
|
||||
|
||||
pub static SCRIPTS_DIR: Lazy<String> = Lazy::new(|| crate::core::admin_config::get_scripts_dir());
|
||||
|
||||
Reference in New Issue
Block a user