forked from nrabulinski/attic
server/upload_path: Refactor
This commit is contained in:
parent
6d3d07cb14
commit
5a8df0b1e8
|
@ -161,6 +161,10 @@ async fn upload_path_dedup(
|
|||
}
|
||||
}
|
||||
|
||||
let file_size = existing_nar.file_size
|
||||
.map(|dbs| dbs.try_into().map_err(ServerError::database_error))
|
||||
.transpose()?;
|
||||
|
||||
// Finally...
|
||||
let txn = database
|
||||
.begin()
|
||||
|
@ -188,10 +192,6 @@ async fn upload_path_dedup(
|
|||
|
||||
txn.commit().await.map_err(ServerError::database_error)?;
|
||||
|
||||
let file_size = existing_nar.file_size
|
||||
.map(|dbs| dbs.try_into().map_err(ServerError::database_error))
|
||||
.transpose()?;
|
||||
|
||||
// Ensure it's not unlocked earlier
|
||||
drop(existing_nar);
|
||||
|
||||
|
|
Loading…
Reference in a new issue