File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Tools/build-swiftly-release Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,12 @@ public final class HTTPRequestExecutorImpl: HTTPRequestExecutor {
152
152
}
153
153
}
154
154
155
+ public func shutdown( ) async throws {
156
+ if httpClient !== HTTPClient . shared {
157
+ try await httpClient. shutdown ( )
158
+ }
159
+ }
160
+
155
161
private func websiteClient( ) throws -> SwiftlyWebsiteAPI . Client {
156
162
let swiftlyUserAgent = SwiftlyUserAgentMiddleware ( )
157
163
let transport : ClientTransport
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import AsyncHTTPClient
3
3
import Foundation
4
4
import SwiftlyCore
5
5
import SystemPackage
6
- import NIOPosix
7
6
8
7
#if os(macOS)
9
8
import MacOSPlatform
@@ -152,6 +151,12 @@ struct BuildSwiftlyRelease: AsyncParsableCommand {
152
151
153
152
// Download libarchive
154
153
let httpExecutor = HTTPRequestExecutorImpl ( )
154
+ defer {
155
+ Task {
156
+ try ? await httpExecutor. shutdown ( )
157
+ }
158
+ }
159
+
155
160
let libarchiveRequest = HTTPClientRequest ( url: " https://github.com/libarchive/libarchive/releases/download/v \( libArchiveVersion) /libarchive- \( libArchiveVersion) .tar.gz " )
156
161
let libarchiveResponse = try await httpExecutor. httpClient. execute ( libarchiveRequest, timeout: . seconds( 60 ) )
157
162
guard libarchiveResponse. status == . ok else {
@@ -182,7 +187,6 @@ struct BuildSwiftlyRelease: AsyncParsableCommand {
182
187
}
183
188
184
189
let swiftVersion = swiftVerMatch. output. 1
185
- print ( " Get toolchains " )
186
190
guard let swiftRelease = ( try await httpExecutor. getReleaseToolchains ( ) ) . first ( where: { $0. name == swiftVersion } ) else {
187
191
throw Error ( message: " Unable to find swift release using swift.org API: \( swiftVersion) " )
188
192
}
You can’t perform that action at this time.
0 commit comments