Isolate pasta uploads from database.json by moving them into pasta_data/public/

This commit is contained in:
Daniel Szabo 2022-07-31 21:49:36 +01:00
parent 7b4cd7c26e
commit 05941f0d6f
4 changed files with 10 additions and 10 deletions

View file

@ -24,7 +24,7 @@ pub fn remove_expired(pastas: &mut Vec<Pasta>) {
// remove the file itself
if let Some(file) = &p.file {
if fs::remove_file(format!(
"./pasta_data/{}/{}",
"./pasta_data/public/{}/{}",
p.id_as_animals(),
file.name()
))
@ -34,7 +34,7 @@ pub fn remove_expired(pastas: &mut Vec<Pasta>) {
}
// and remove the containing directory
if fs::remove_dir(format!("./pasta_data/{}/", p.id_as_animals())).is_err() {
if fs::remove_dir(format!("./pasta_data/public/{}/", p.id_as_animals())).is_err() {
log::error!("Failed to delete directory {}!", file.name())
}
}