Skip to content

Commit

Permalink
Remove PostgresClientService
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed May 14, 2024
1 parent 5769176 commit dd1504e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ DerivedData/
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc
.vscode
.devcontainer
Package.resolved
4 changes: 2 additions & 2 deletions Tests/HummingbirdPostgresTests/JobsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ final class JobsTests: XCTestCase {
return try await withThrowingTaskGroup(of: Void.self) { group in
let serviceGroup = ServiceGroup(
configuration: .init(
services: [PostgresClientService(client: jobQueue.queue.client), jobQueue],
services: [jobQueue.queue.client, jobQueue],
gracefulShutdownSignals: [.sigterm, .sigint],
logger: jobQueue.queue.logger
)
Expand Down Expand Up @@ -352,7 +352,7 @@ final class JobsTests: XCTestCase {
try await withThrowingTaskGroup(of: Void.self) { group in
let serviceGroup = ServiceGroup(
configuration: .init(
services: [PostgresClientService(client: postgresClient), jobQueue, jobQueue2],
services: [postgresClient, jobQueue, jobQueue2],
gracefulShutdownSignals: [.sigterm, .sigint],
logger: logger
)
Expand Down
2 changes: 1 addition & 1 deletion Tests/HummingbirdPostgresTests/PersistTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ final class PersistTests: XCTestCase {
}
updateRouter(router, persist)
var app = Application(responder: router.buildResponder())
app.addServices(PostgresClientService(client: postgresClient), persist)
app.addServices(postgresClient, persist)
app.runBeforeServerStart {
try await postgresMigrations.apply(client: postgresClient, groups: [.persist], logger: logger, dryRun: false)
}
Expand Down
11 changes: 0 additions & 11 deletions Tests/HummingbirdPostgresTests/TestUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,6 @@ import Hummingbird
import PostgresNIO
import ServiceLifecycle

/// Manage the lifecycle of a PostgresClient
struct PostgresClientService: Service {
let client: PostgresClient

func run() async {
await cancelOnGracefulShutdown {
await self.client.run()
}
}
}

func getPostgresConfiguration() async throws -> PostgresClient.Configuration {
let env = try await Environment.shared.merging(with: .dotEnv())
return .init(
Expand Down

0 comments on commit dd1504e

Please sign in to comment.