From 496fcf912facad3c857f47495db2206e3e94b784 Mon Sep 17 00:00:00 2001 From: "Sven A. Schmidt" Date: Wed, 4 Oct 2023 10:03:57 +0200 Subject: [PATCH] Remove task group --- Sources/App/Commands/Analyze.swift | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/Sources/App/Commands/Analyze.swift b/Sources/App/Commands/Analyze.swift index 2d19bb712..7e7e9a498 100644 --- a/Sources/App/Commands/Analyze.swift +++ b/Sources/App/Commands/Analyze.swift @@ -183,18 +183,11 @@ extension Analyze { try await createCheckoutsDirectory(client: client, logger: logger, path: checkoutDir) } - let packageResults = await withThrowingTaskGroup( - of: (Joined).self, - returning: [Result<(Joined), Error>].self - ) { group in - for pkg in packages { - group.addTask { - try await analyze(client: client, database: database, logger: logger, package: pkg) - return pkg - } + let packageResults = await packages.mapAsync { pkg in + await Result { + try await analyze(client: client, database: database, logger: logger, package: pkg) + return pkg } - - return await group.results() } try await updatePackages(client: client,