diff --git a/src/data_store/mod.rs b/src/data_store/mod.rs index 940187b..04491b1 100644 --- a/src/data_store/mod.rs +++ b/src/data_store/mod.rs @@ -3,6 +3,7 @@ use anyhow::Result; use camino::Utf8PathBuf; use parquet::arrow::AsyncArrowWriter; +use tracing::debug; use crate::{directories::data_cache_directory, malie::models::Index}; @@ -18,6 +19,11 @@ impl Store { } pub async fn write_index(&self, index: Index) -> Result<()> { + let path = self.data_cache_directory.join("ptcgl_index.parquet"); + if let Ok(true) = tokio::fs::try_exists(&path).await { + debug!("File {path} already exists, skipping."); + return Ok(()); + } // let mut writer = AsyncArrowWriter::try_new(writer, arrow_schema, props) Ok(()) }