Avoid failed identifier cleanup on failed duplicate upload

This commit is contained in:
asonix 2023-06-23 11:43:15 -05:00
parent 7ba2fc9b26
commit 0d1df5ebc2
1 changed files with 1 additions and 0 deletions

View File

@ -118,6 +118,7 @@ where
if HashRepo::create(repo, hash.to_vec().into()).await?.is_err() { if HashRepo::create(repo, hash.to_vec().into()).await?.is_err() {
// duplicate upload // duplicate upload
store.remove(identifier).await?; store.remove(identifier).await?;
session.identifier.take();
return Ok(()); return Ok(());
} }