Skip to content

Commit 0111936

Browse files
committed
Fix build error.
#366 (comment)
1 parent 9e2b98d commit 0111936

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

Scripts/DowloadPortalItemData.swift

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ let previousDownloadedItems: DownloadedItems = {
228228
}()
229229
var downloadedItems = previousDownloadedItems
230230

231-
await withTaskGroup(of: (Identifier, Filename?).self) { group in
231+
await withTaskGroup(of: Void.self) { group in
232232
for portalItem in portalItems {
233233
// Checks to see if an item is already downloaded.
234234
guard downloadedItems[portalItem.identifier] == nil else {
@@ -263,21 +263,19 @@ await withTaskGroup(of: (Identifier, Filename?).self) { group in
263263
from: portalItem.dataURL,
264264
to: destinationURL
265265
)
266-
return (portalItem.identifier, downloadName)
266+
print("note: Downloaded item: \(portalItem.identifier)")
267+
fflush(stdout)
268+
269+
await MainActor.run {
270+
downloadedItems[portalItem.identifier] = downloadName
271+
}
267272
} catch {
268273
print("error: Error downloading item \(portalItem.identifier): \(error.localizedDescription)")
269274
URLSession.shared.invalidateAndCancel()
270275
exit(1)
271276
}
272277
}
273278
}
274-
275-
for await (identifier, filename) in group {
276-
downloadedItems[identifier] = filename
277-
278-
print("note: Downloaded item: \(identifier)")
279-
fflush(stdout)
280-
}
281279
}
282280

283281
// Updates the downloaded items property list record if needed.

0 commit comments

Comments
 (0)