diff --git a/Package.swift b/Package.swift index 7b55070..c8ce730 100644 --- a/Package.swift +++ b/Package.swift @@ -10,7 +10,7 @@ let package = Package( .library(name: "HummingbirdPostgres", targets: ["HummingbirdPostgres"]), ], dependencies: [ - .package(url: "https://github.com/hummingbird-project/hummingbird.git", branch: "remove-hb-prefix"), + .package(url: "https://github.com/hummingbird-project/hummingbird.git", branch: "main"), .package(url: "https://github.com/vapor/postgres-nio", from: "1.20.0"), ], targets: [ diff --git a/Tests/HummingbirdPostgresTests/JobsTests.swift b/Tests/HummingbirdPostgresTests/JobsTests.swift index d0b6903..f145d10 100644 --- a/Tests/HummingbirdPostgresTests/JobsTests.swift +++ b/Tests/HummingbirdPostgresTests/JobsTests.swift @@ -130,7 +130,7 @@ final class JobsTests: XCTestCase { let expectation = XCTestExpectation(description: "TestJob.execute was called", expectedFulfillmentCount: 10) let jobIdentifer = JobIdentifier(#function) try await self.testJobQueue(numWorkers: 1) { jobQueue in - jobQueue.registerJob(jobIdentifer) { parameters, context in + jobQueue.registerJob(id: jobIdentifer) { parameters, context in context.logger.info("Parameters=\(parameters)") try await Task.sleep(for: .milliseconds(Int.random(in: 10..<50))) expectation.fulfill() @@ -157,7 +157,7 @@ final class JobsTests: XCTestCase { let expectation = XCTestExpectation(description: "TestJob.execute was called", expectedFulfillmentCount: 10) try await self.testJobQueue(numWorkers: 4) { jobQueue in - jobQueue.registerJob(jobIdentifer) { parameters, context in + jobQueue.registerJob(id: jobIdentifer) { parameters, context in let runningJobs = runningJobCounter.wrappingIncrementThenLoad(by: 1, ordering: .relaxed) if runningJobs > maxRunningJobCounter.load(ordering: .relaxed) { maxRunningJobCounter.store(runningJobs, ordering: .relaxed) @@ -191,7 +191,7 @@ final class JobsTests: XCTestCase { let expectation = XCTestExpectation(description: "TestJob.execute was called", expectedFulfillmentCount: 4) struct FailedError: Error {} try await self.testJobQueue(numWorkers: 1) { jobQueue in - jobQueue.registerJob(jobIdentifer, maxRetryCount: 3) { _, _ in + jobQueue.registerJob(id: jobIdentifer, maxRetryCount: 3) { _, _ in expectation.fulfill() throw FailedError() } @@ -215,7 +215,7 @@ final class JobsTests: XCTestCase { let expectation = XCTestExpectation(description: "TestJob.execute was called") let jobIdentifer = JobIdentifier(#function) try await self.testJobQueue(numWorkers: 1) { jobQueue in - jobQueue.registerJob(jobIdentifer) { parameters, _ in + jobQueue.registerJob(id: jobIdentifer) { parameters, _ in XCTAssertEqual(parameters.id, 23) XCTAssertEqual(parameters.message, "Hello!") expectation.fulfill() @@ -232,7 +232,7 @@ final class JobsTests: XCTestCase { let expectation = XCTestExpectation(description: "TestJob.execute was called", expectedFulfillmentCount: 1) try await self.testJobQueue(numWorkers: 4) { jobQueue in - jobQueue.registerJob(jobIdentifer) { _, _ in + jobQueue.registerJob(id: jobIdentifer) { _, _ in expectation.fulfill() try await Task.sleep(for: .milliseconds(1000)) } @@ -255,7 +255,7 @@ final class JobsTests: XCTestCase { let expectation = XCTestExpectation(description: "job was called", expectedFulfillmentCount: 1) try await self.testJobQueue(numWorkers: 4) { jobQueue in - jobQueue.registerJob(jobIdentifer2) { parameters, _ in + jobQueue.registerJob(id: jobIdentifer2) { parameters, _ in string.withLockedValue { $0 = parameters } expectation.fulfill() }