@@ -262,22 +262,14 @@ enum Ingestion {
262262 throw Github . Error. requestFailed ( . internalServerError)
263263 }
264264
265- // Work-around for
266- // Sending 'github' into async let risks causing data races between async let uses and local uses
267- // if we declare
268- // @Dependency(\.github) var github
269- // up front. It needs to be local to each task instead.
270- func _fetchMetadata( ) async throws ( Github . Error) - > Github. Metadata {
271- @Dependency ( \. github) var github
272- return try await github. fetchMetadata ( owner, repository)
273- }
274- func _fetchLicense( ) async -> Github . License ? {
275- @Dependency ( \. github) var github
276- return await github. fetchLicense ( owner, repository)
277- }
278-
279- async let metadata = try await _fetchMetadata ( )
280- async let license = await _fetchLicense ( )
265+ // Need to pull in github functions individually, because otherwise the `async let` will trigger a
266+ // concurrency error if github gets used more than once:
267+ // Sending 'github' into async let risks causing data races between async let uses and local uses
268+ @Dependency ( \. github. fetchMetadata) var fetchMetadata
269+ @Dependency ( \. github. fetchLicense) var fetchLicense
270+
271+ async let metadata = try await fetchMetadata ( owner, repository)
272+ async let license = await fetchLicense ( owner, repository)
281273 async let readme = await Current . fetchReadme ( client, owner, repository)
282274
283275 do {
0 commit comments