server: continue if db path missing on create_news_db

This commit is contained in:
Bill Thiede 2024-09-28 12:22:12 -07:00
parent ebf32a9905
commit f36d1e0c29

View File

@ -147,7 +147,8 @@ impl TantivyConnection {
fn create_news_db(tantivy_db_path: &str) -> Result<(), TantivyError> {
info!("create_news_db");
std::fs::remove_dir_all(tantivy_db_path)?;
// Don't care if directory didn't exist
let _ = std::fs::remove_dir_all(tantivy_db_path);
std::fs::create_dir_all(tantivy_db_path)?;
use tantivy::schema::*;
let mut schema_builder = Schema::builder();