Skip to content

Commit a8e8419

Browse files
committed
Remove AppEnvironment.httpClient and setHTTPClient
1 parent 7df64b8 commit a8e8419

File tree

3 files changed

+0
-8
lines changed

3 files changed

+0
-8
lines changed

Sources/App/Core/AppEnvironment.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,12 @@ struct AppEnvironment: Sendable {
3636
var gitlabPipelineLimit: @Sendable () -> Int
3737
var hideStagingBanner: @Sendable () -> Bool
3838
var maintenanceMessage: @Sendable () -> String?
39-
var httpClient: @Sendable () -> Client
4039
var loadSPIManifest: @Sendable (String) -> SPIManifest.Manifest?
4140
var logger: @Sendable () -> Logger
4241
var metricsPushGatewayUrl: @Sendable () -> String?
4342
var plausibleBackendReportingSiteID: @Sendable () -> String?
4443
var processingBuildBacklog: @Sendable () -> Bool
4544
var runnerIds: @Sendable () -> [String]
46-
var setHTTPClient: @Sendable (Client) -> Void
4745
var setLogger: @Sendable (Logger) -> Void
4846
var shell: Shell
4947
var siteURL: @Sendable () -> String
@@ -65,7 +63,6 @@ struct AppEnvironment: Sendable {
6563

6664

6765
extension AppEnvironment {
68-
nonisolated(unsafe) static var httpClient: Client!
6966
nonisolated(unsafe) static var logger: Logger!
7067

7168
static let live = AppEnvironment(
@@ -96,7 +93,6 @@ extension AppEnvironment {
9693
maintenanceMessage: {
9794
Environment.get("MAINTENANCE_MESSAGE").flatMap(\.trimmed)
9895
},
99-
httpClient: { httpClient },
10096
loadSPIManifest: { path in SPIManifest.Manifest.load(in: path) },
10197
logger: { logger },
10298
metricsPushGatewayUrl: { Environment.get("METRICS_PUSHGATEWAY_URL") },
@@ -110,7 +106,6 @@ extension AppEnvironment {
110106
.flatMap { try? JSONDecoder().decode([String].self, from: $0) }
111107
?? []
112108
},
113-
setHTTPClient: { client in Self.httpClient = client },
114109
setLogger: { logger in Self.logger = logger },
115110
shell: .live,
116111
siteURL: { Environment.get("SITE_URL") ?? "http://localhost:8080" },

Sources/App/configure.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ public func configure(_ app: Application) async throws -> String {
2727

2828
app.logger.component = "server"
2929
Current.setLogger(app.logger)
30-
Current.setHTTPClient(app.client)
3130

3231
// It will be tempting to uncomment/re-add these lines in the future. We should not enable
3332
// server-side compression as long as we pass requests through Cloudflare, which compresses

Tests/AppTests/Mocks/AppEnvironment+mock.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,12 @@ extension AppEnvironment {
3535
gitlabPipelineLimit: { Constants.defaultGitlabPipelineLimit },
3636
hideStagingBanner: { false },
3737
maintenanceMessage: { nil },
38-
httpClient: { httpClient },
3938
loadSPIManifest: { _ in nil },
4039
logger: { logger },
4140
metricsPushGatewayUrl: { "http://pushgateway:9091" },
4241
plausibleBackendReportingSiteID: { nil },
4342
processingBuildBacklog: { false },
4443
runnerIds: { [] },
45-
setHTTPClient: { client in Self.httpClient = client },
4644
setLogger: { logger in Self.logger = logger },
4745
shell: .mock,
4846
siteURL: { Environment.get("SITE_URL") ?? "http://localhost:8080" },

0 commit comments

Comments
 (0)