From 4a407afd9fee75bcda97c6071e1ffd5d559014ea Mon Sep 17 00:00:00 2001 From: asonix Date: Thu, 13 Jul 2023 19:59:39 -0500 Subject: [PATCH] Fix alias cleanup ordering --- src/queue/cleanup.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/queue/cleanup.rs b/src/queue/cleanup.rs index 8d801a7..3d6c162 100644 --- a/src/queue/cleanup.rs +++ b/src/queue/cleanup.rs @@ -95,6 +95,8 @@ where // TODO: decide if it is okay to skip aliases without tokens if let Some(token) = repo.delete_token(&alias).await? { super::cleanup_alias(repo, alias, token).await?; + } else { + tracing::warn!("Not cleaning alias!"); } } // Return after queueing cleanup alias, since we will be requeued when the last alias is cleaned @@ -130,9 +132,11 @@ where return Err(UploadError::InvalidToken.into()); } + let hash = repo.hash(&alias).await?; + AliasRepo::cleanup(repo, &alias).await?; - let Some(hash) = repo.hash(&alias).await? else { + let Some(hash) = hash else { // hash doesn't exist, nothing to do return Ok(()); };