forked from nrabulinski/attic
server/upload-path: Set completeness hint when NAR is deduplicated
This commit is contained in:
parent
f1c6dbde67
commit
fb1101f54d
1 changed files with 15 additions and 0 deletions
|
@ -224,6 +224,21 @@ async fn upload_path_dedup(
|
||||||
.await
|
.await
|
||||||
.map_err(ServerError::database_error)?;
|
.map_err(ServerError::database_error)?;
|
||||||
|
|
||||||
|
// Also mark the NAR as complete again
|
||||||
|
//
|
||||||
|
// This is racy (a chunkref might have been broken in the
|
||||||
|
// meantime), but it's okay since it's just a hint to
|
||||||
|
// `get-missing-paths` so clients don't attempt to upload
|
||||||
|
// again. Also see the comments in `server/src/database/entity/nar.rs`.
|
||||||
|
Nar::update(nar::ActiveModel {
|
||||||
|
id: Set(existing_nar.id),
|
||||||
|
completeness_hint: Set(true),
|
||||||
|
..Default::default()
|
||||||
|
})
|
||||||
|
.exec(&txn)
|
||||||
|
.await
|
||||||
|
.map_err(ServerError::database_error)?;
|
||||||
|
|
||||||
txn.commit().await.map_err(ServerError::database_error)?;
|
txn.commit().await.map_err(ServerError::database_error)?;
|
||||||
|
|
||||||
// Ensure it's not unlocked earlier
|
// Ensure it's not unlocked earlier
|
||||||
|
|
Loading…
Reference in a new issue