From 4b655b8814056a992311819d75da9dbe20e6055d Mon Sep 17 00:00:00 2001 From: perf3ct Date: Sat, 19 Jul 2025 21:41:26 +0000 Subject: [PATCH] fix(startup): remove annoying function check output from startup --- src/main.rs | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/src/main.rs b/src/main.rs index f7345b4..ac2d059 100644 --- a/src/main.rs +++ b/src/main.rs @@ -268,48 +268,6 @@ async fn main() -> anyhow::Result<()> { ) .fetch_one(web_db.get_pool()) .await; - - match function_check { - Ok(Some(def)) => { - info!("๐Ÿ“‹ get_queue_statistics function definition retrieved"); - - // Debug: print the actual function definition - info!("๐Ÿ” Function definition (first 500 chars): {}", - def.chars().take(500).collect::()); - - // Check if it contains the correct logic from our latest migration - let has_documents_subquery = def.contains("FROM documents") && def.contains("ocr_status = 'completed'"); - let has_cast_statements = def.contains("CAST("); - - info!("๐Ÿ” Function content analysis:"); - info!(" Has documents subquery: {}", has_documents_subquery); - info!(" Has CAST statements: {}", has_cast_statements); - - if has_documents_subquery && has_cast_statements { - info!("โœ… get_queue_statistics function has correct logic (uses documents table subquery with CAST)"); - } else { - error!("โŒ get_queue_statistics function has unexpected structure"); - } - - // Test the function execution at startup - info!("๐Ÿงช Testing function execution at startup..."); - match sqlx::query("SELECT * FROM get_queue_statistics()").fetch_one(web_db.get_pool()).await { - Ok(test_result) => { - info!("โœ… Function executes successfully at startup"); - let columns = test_result.columns(); - info!("๐Ÿ” Function returns {} columns at startup:", columns.len()); - for (i, column) in columns.iter().enumerate() { - info!(" Column {}: name='{}', type='{:?}'", i, column.name(), column.type_info()); - } - } - Err(e) => { - error!("โŒ Function fails to execute at startup: {}", e); - } - } - } - Ok(None) => error!("โŒ get_queue_statistics function does not exist after migration"), - Err(e) => error!("โŒ Failed to verify get_queue_statistics function: {}", e), - } } Err(e) => { error!("โŒ CRITICAL: SQLx migrations failed!");