From 85bd1a3e6cbf088b23f2112a7471e4a47ed6aa82 Mon Sep 17 00:00:00 2001 From: Zynh Ludwig Date: Fri, 27 Dec 2024 03:05:12 -0800 Subject: [PATCH] refactor: unify cache directory --- src/main.rs | 2 +- src/router/upload.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index b11c713..91d0482 100644 --- a/src/main.rs +++ b/src/main.rs @@ -20,7 +20,7 @@ async fn main() -> io::Result<()> { logging::init_tracing(); // uses create_dir_all to create both .cache and serve inside it in one go - util::make_dir(".cache/serve").await?; + util::make_dir(&*CACHE_DIR).await?; let state = AppState::new(); diff --git a/src/router/upload.rs b/src/router/upload.rs index d3d5ace..1d99763 100644 --- a/src/router/upload.rs +++ b/src/router/upload.rs @@ -32,7 +32,7 @@ async fn upload_to_zip( ) -> Result { let cache_name = util::get_random_name(10); - let archive_path = Path::new(".cache/serve").join(&cache_name); + let archive_path = crate::CACHE_DIR.join(&cache_name); tracing::debug!("Zipping: {:?}", &archive_path);