Bound restore and publication verification downloads

This commit is contained in:
2026-12-01 20:28:13 +00:00
parent 6f5464615e
commit 59813b72fa
15 changed files with 211 additions and 37 deletions

View File

@@ -131,7 +131,8 @@ func executeRestoreDownloadAction(
_, err := io.Copy(destination, bytes.NewReader(action.VerifiedContent))
return err
}
return storage.DownloadTo(ctx, store, action.RemoteKey, destination)
_, err := storage.StreamObject(ctx, store, action.RemoteKey, destination, restoreExpectedSize(action))
return err
})
if err != nil {
return fmt.Errorf("download to temp file: %w", err)
@@ -359,8 +360,9 @@ func executeRestoreAudioAction(
Size: action.Size,
ETag: action.ETag,
},
Bucket: strings.TrimSpace(cfg.Pipeline.Storage.S3.Bucket),
DestPath: temporaryPath,
ExpectedSize: restoreExpectedSize(action),
Bucket: strings.TrimSpace(cfg.Pipeline.Storage.S3.Bucket),
DestPath: temporaryPath,
})
if err != nil {
return fmt.Errorf("materialize audio: %w", err)