From dd4ce58b346ec50b8df8bbb770ddca41e50ea4fb Mon Sep 17 00:00:00 2001 From: Pixo Date: Tue, 21 Nov 2023 18:19:11 +0100 Subject: [PATCH] [_]:WIP test multipart upload --- .../InternxtSwiftCore/Services/Network/NetworkFacade.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/InternxtSwiftCore/Services/Network/NetworkFacade.swift b/Sources/InternxtSwiftCore/Services/Network/NetworkFacade.swift index e9f2f4d..9a23931 100644 --- a/Sources/InternxtSwiftCore/Services/Network/NetworkFacade.swift +++ b/Sources/InternxtSwiftCore/Services/Network/NetworkFacade.swift @@ -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] @@ -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)