Skip to content

Commit 82e0f4b

Browse files
committed
Register cleanup job
This currently assumes there is only one postgres job queue. Need the changes splitting job id from parameters to implement for every queue
1 parent 1a1d91d commit 82e0f4b

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

Sources/JobsPostgres/JobCleanupParameters.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,15 @@ import Jobs
1717
public struct JobCleanupParameters: JobParameters {
1818
static public var jobName: String { "_JobCleanup_" }
1919

20-
let jobQueueName: String
2120
let failedJobs: PostgresJobQueue.JobCleanup
2221
let completedJobs: PostgresJobQueue.JobCleanup
2322
let cancelledJobs: PostgresJobQueue.JobCleanup
2423

2524
public init(
26-
jobQueueName: String,
2725
failedJobs: PostgresJobQueue.JobCleanup = .doNothing,
2826
completedJobs: PostgresJobQueue.JobCleanup = .doNothing,
2927
cancelledJobs: PostgresJobQueue.JobCleanup = .doNothing
3028
) {
31-
self.jobQueueName = jobQueueName
3229
self.failedJobs = failedJobs
3330
self.completedJobs = completedJobs
3431
self.cancelledJobs = cancelledJobs

Sources/JobsPostgres/PostgresJobsQueue.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public final class PostgresJobQueue: JobQueueDriver, CancellableJobQueue, Resuma
180180
await migrations.add(CreateSwiftJobsMigrations(), skipDuplicates: true)
181181
self.registerJob(
182182
JobDefinition(parameters: JobCleanupParameters.self, retryStrategy: .dontRetry) { parameters, context in
183-
parameters.jobQueue.cleanup(
183+
try await self.cleanup(
184184
failedJobs: parameters.failedJobs,
185185
processingJobs: .doNothing,
186186
pendingJobs: .doNothing,

0 commit comments

Comments
 (0)