diff options
author | metamuffin <metamuffin@disroot.org> | 2023-12-25 15:46:27 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-12-25 15:46:27 +0100 |
commit | c5d484e16bae5d923f6a3c441827d3d470bfee6e (patch) | |
tree | 24fbd414997761be187537a9801ef7a3afccc11d /import | |
parent | abf60ddb6b7c6edd97046bfc9727c350ee2d94c3 (diff) | |
download | jellything-c5d484e16bae5d923f6a3c441827d3d470bfee6e.tar jellything-c5d484e16bae5d923f6a3c441827d3d470bfee6e.tar.bz2 jellything-c5d484e16bae5d923f6a3c441827d3d470bfee6e.tar.zst |
clean up old node_import tree
Diffstat (limited to 'import')
-rw-r--r-- | import/src/lib.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/import/src/lib.rs b/import/src/lib.rs index f804871..ff687d7 100644 --- a/import/src/lib.rs +++ b/import/src/lib.rs @@ -42,6 +42,10 @@ static IMPORT_SEM: LazyLock<Semaphore> = LazyLock::new(|| Semaphore::new(1)); pub async fn import(db: &Database, fed: &Federation) -> anyhow::Result<()> { let permit = IMPORT_SEM.try_acquire()?; + if !db.node_import.is_empty() { + info!("clearing temporary node tree from an aborted last import..."); + db.node_import.clear()?; + } info!("loading sources..."); import_path(CONF.library_path.clone(), vec![], db, fed) .await @@ -277,7 +281,7 @@ async fn process_source( if let Some((filename, data)) = metadata.cover { node.private.poster = Some( async_cache_file( - &[media_path.to_str().unwrap(), &filename], + &["att-cover", media_path.to_str().unwrap(), &filename], |mut f| async move { f.write_all(&data).await?; Ok(()) |