Skip to content

Commit b6b17f2

Browse files
committed
PR comments
1 parent b496ade commit b6b17f2

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

Sources/JobsPostgres/PostgresJobsQueue.swift

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public final class PostgresJobQueue: JobQueueDriver {
7070
/// Default initializer for JobOptions
7171
public init() {
7272
self.delayUntil = .now
73-
self.priority = .lowest
73+
self.priority = .normal
7474
}
7575

7676
/// Initializer for JobOptions
@@ -87,14 +87,6 @@ public final class PostgresJobQueue: JobQueueDriver {
8787
self.delayUntil = delayUntil
8888
self.priority = priority
8989
}
90-
91-
/// Initializer for JobOptions
92-
/// - Parameter delayUntil: Whether job execution should be delayed until a later date
93-
/// - Parameter priority: The priority for a job
94-
public init(delayUntil: Date?, priority: JobPriority = .normal) {
95-
self.delayUntil = delayUntil ?? .now
96-
self.priority = priority
97-
}
9890
}
9991

10092
/// Errors thrown by PostgresJobQueue

Tests/JobsPostgresTests/JobsTests.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -292,13 +292,13 @@ final class JobsTests: XCTestCase {
292292
try await withThrowingTaskGroup(of: Void.self) { group in
293293
let serviceGroup = ServiceGroup(services: [queue], logger: queue.logger)
294294

295+
let processingJobs = try await jobQueue.queue.getJobs(withStatus: .pending)
296+
XCTAssertEqual(processingJobs.count, 2)
297+
295298
group.addTask {
296299
try await serviceGroup.run()
297300
}
298301

299-
let processingJobs = try await jobQueue.queue.getJobs(withStatus: .pending)
300-
XCTAssertEqual(processingJobs.count, 2)
301-
302302
await fulfillment(of: [expectation], timeout: 10)
303303

304304
let pendingJobs = try await jobQueue.queue.getJobs(withStatus: .pending)
@@ -347,13 +347,13 @@ final class JobsTests: XCTestCase {
347347
try await withThrowingTaskGroup(of: Void.self) { group in
348348
let serviceGroup = ServiceGroup(services: [queue], logger: queue.logger)
349349

350+
let processingJobs = try await jobQueue.queue.getJobs(withStatus: .pending)
351+
XCTAssertEqual(processingJobs.count, 2)
352+
350353
group.addTask {
351354
try await serviceGroup.run()
352355
}
353356

354-
let processingJobs = try await jobQueue.queue.getJobs(withStatus: .pending)
355-
XCTAssertEqual(processingJobs.count, 2)
356-
357357
await fulfillment(of: [expectation], timeout: 10)
358358

359359
let pendingJobs = try await jobQueue.queue.getJobs(withStatus: .pending)

0 commit comments

Comments
 (0)