Skip to content

Commit 79fa6e8

Browse files
committed
add missing arguments
1 parent ecc11f9 commit 79fa6e8

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

Sources/Hub/Downloader.swift

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,18 @@ class Downloader: NSObject, ObservableObject {
5555

5656
self.urlSession = URLSession(configuration: config, delegate: self, delegateQueue: nil)
5757

58-
setupDownload(from: url, with: authToken)
58+
setupDownload(from: url, with: authToken, resumeSize: resumeSize, headers: headers, expectedSize: expectedSize, timeout: timeout, numRetries: numRetries)
5959
}
6060

61-
private func setupDownload(from url: URL, with authToken: String?) {
61+
private func setupDownload(
62+
from url: URL,
63+
with authToken: String?,
64+
resumeSize: Int,
65+
headers: [String: String]?,
66+
expectedSize: Int?,
67+
timeout: TimeInterval,
68+
numRetries: Int
69+
) {
6270
downloadState.value = .downloading(0)
6371
urlSession?.getAllTasks { tasks in
6472
// If there's an existing pending background task with the same URL, let it proceed.
@@ -213,7 +221,7 @@ class Downloader: NSObject, ObservableObject {
213221
throw DownloadError.unexpectedError
214222
}
215223
}
216-
224+
217225
@discardableResult
218226
func waitUntilDone() throws -> URL {
219227
// It's either this, or stream the bytes ourselves (add to a buffer, save to disk, etc; boring and finicky)

Sources/Hub/HubApi.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ public extension HubApi {
367367
// From now on, etag, commit_hash, url and size are not empty
368368
guard let remoteCommitHash = remoteMetadata.commitHash,
369369
let remoteEtag = remoteMetadata.etag,
370+
let remoteSize = remoteMetadata.size,
370371
remoteMetadata.location != "" else {
371372
throw EnvironmentError.invalidMetadataError("File metadata must have been retrieved from server")
372373
}

0 commit comments

Comments
 (0)