mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-09-10 10:45:57 +03:00
Add option to make file uploads use move_copy_to instead of persist_to
This is to support scenarios where the attachments and sends folder are to be stored on a separate device from the tmp_folder (i.e. fuse-mounted S3 storage), due to having the tmp_dir on the same device being undesirable. Example being fuse-mounted S3 storage with the reasoning that because S3 basically requires a copy+delete operations to rename files, it's inefficient to rename files on device, if it's even allowed.
This commit is contained in:
@@ -998,7 +998,11 @@ async fn save_attachment(
|
||||
attachment.save(&conn).await.expect("Error saving attachment");
|
||||
}
|
||||
|
||||
data.data.persist_to(file_path).await?;
|
||||
if CONFIG.uploads_use_copy() {
|
||||
data.data.move_copy_to(file_path).await?;
|
||||
} else {
|
||||
data.data.persist_to(file_path).await?;
|
||||
}
|
||||
|
||||
nt.send_cipher_update(UpdateType::CipherUpdate, &cipher, &cipher.update_users_revision(&conn).await).await;
|
||||
|
||||
|
Reference in New Issue
Block a user