Skip to content

Commit

Permalink
[_]:WIP test multipart upload
Browse files Browse the repository at this point in the history
  • Loading branch information
PixoDev committed Nov 21, 2023
1 parent e2d257e commit dd4ce58
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public struct NetworkFacade {
let uploadRefs = try await uploadMultipart.start(bucketId: bucketId, fileSize: fileSize, parts: Int(parts))

print("REFS", uploadRefs)
func processEncryptedChunk(encryptedChunk: Data) async throws -> Void {
func processEncryptedChunk(encryptedChunk: Data, partIndex: Int) async throws -> Void {
let hash = encrypt.getFileContentHash(stream: InputStream(data: encryptedChunk))
let uploadRef = uploadRefs[partIndex]

Expand Down Expand Up @@ -146,7 +146,7 @@ public struct NetworkFacade {

// If something fails here, the error is propagated
// and the stream reading is stopped
try await processEncryptedChunk(encryptedChunk: encryptedChunk)
try await processEncryptedChunk(encryptedChunk: encryptedChunk, partIndex: partIndex)
partIndex += 1

print("NEW PART INDEX", partIndex)
Expand Down

0 comments on commit dd4ce58

Please sign in to comment.