mirror of
https://git.asonix.dog/asonix/pict-rs
synced 2024-12-22 11:21:24 +00:00
Fix Alias cleanup ordering
Update dev.toml
This commit is contained in:
parent
a32355c064
commit
afeac8294a
2 changed files with 9 additions and 2 deletions
5
dev.toml
5
dev.toml
|
@ -21,6 +21,11 @@ path = 'data/'
|
||||||
max_file_size = 40
|
max_file_size = 40
|
||||||
filters = ['blur', 'crop', 'identity', 'resize', 'thumbnail']
|
filters = ['blur', 'crop', 'identity', 'resize', 'thumbnail']
|
||||||
|
|
||||||
|
[media.animation]
|
||||||
|
max_width = 2000
|
||||||
|
max_height = 2000
|
||||||
|
max_area = 2000000
|
||||||
|
|
||||||
[media.video]
|
[media.video]
|
||||||
enable = true
|
enable = true
|
||||||
allow_audio = true
|
allow_audio = true
|
||||||
|
|
|
@ -95,6 +95,8 @@ where
|
||||||
// TODO: decide if it is okay to skip aliases without tokens
|
// TODO: decide if it is okay to skip aliases without tokens
|
||||||
if let Some(token) = repo.delete_token(&alias).await? {
|
if let Some(token) = repo.delete_token(&alias).await? {
|
||||||
super::cleanup_alias(repo, alias, token).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
|
// Return after queueing cleanup alias, since we will be requeued when the last alias is cleaned
|
||||||
|
@ -130,13 +132,13 @@ where
|
||||||
return Err(UploadError::InvalidToken.into());
|
return Err(UploadError::InvalidToken.into());
|
||||||
}
|
}
|
||||||
|
|
||||||
AliasRepo::cleanup(repo, &alias).await?;
|
|
||||||
|
|
||||||
let Some(hash) = repo.hash(&alias).await? else {
|
let Some(hash) = repo.hash(&alias).await? else {
|
||||||
// hash doesn't exist, nothing to do
|
// hash doesn't exist, nothing to do
|
||||||
return Ok(());
|
return Ok(());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
AliasRepo::cleanup(repo, &alias).await?;
|
||||||
|
|
||||||
repo.remove_alias(hash.clone(), &alias).await?;
|
repo.remove_alias(hash.clone(), &alias).await?;
|
||||||
|
|
||||||
if repo.aliases(hash.clone()).await?.is_empty() {
|
if repo.aliases(hash.clone()).await?.is_empty() {
|
||||||
|
|
Loading…
Reference in a new issue