diff --git a/src/queue/cleanup.rs b/src/queue/cleanup.rs index 8f1294c..3d6c162 100644 --- a/src/queue/cleanup.rs +++ b/src/queue/cleanup.rs @@ -132,13 +132,15 @@ where return Err(UploadError::InvalidToken.into()); } - let Some(hash) = repo.hash(&alias).await? else { + let hash = repo.hash(&alias).await?; + + AliasRepo::cleanup(repo, &alias).await?; + + let Some(hash) = hash else { // hash doesn't exist, nothing to do return Ok(()); }; - AliasRepo::cleanup(repo, &alias).await?; - repo.remove_alias(hash.clone(), &alias).await?; if repo.aliases(hash.clone()).await?.is_empty() {