@@ -308,7 +308,7 @@ public final class PostgresJobQueue: JobQueueDriver, CancellableJobQueue, Resuma
308
308
)
309
309
return insertedJobID
310
310
}
311
-
311
+
312
312
if insertedJob != jobID {
313
313
// TODO: introduce a duplicate jobID error
314
314
throw JobQueueError ( code: . unrecognisedJobId, jobName: Parameters . jobName)
@@ -318,15 +318,15 @@ public final class PostgresJobQueue: JobQueueDriver, CancellableJobQueue, Resuma
318
318
319
319
/// Retry an existing Job
320
320
/// - Parameters
321
- /// - id : Job instance ID
321
+ /// - jobID : Job instance ID
322
322
/// - jobRequest: Job Request
323
323
/// - options: Job retry options
324
- public func retry< Parameters: JobParameters > ( _ id : JobID , jobRequest: JobRequest < Parameters > , options: JobRetryOptions ) async throws {
324
+ public func retry< Parameters: JobParameters > ( _ jobID : JobID , jobRequest: JobRequest < Parameters > , options: JobRetryOptions ) async throws {
325
325
let buffer = try self . jobRegistry. encode ( jobRequest: jobRequest)
326
326
try await self . client. withTransaction ( logger: self . logger) { connection in
327
- try await self . updateJob ( id : id , buffer: buffer, connection: connection)
327
+ try await self . updateJob ( jobID : jobID , buffer: buffer, connection: connection)
328
328
try await self . addToQueue (
329
- jobID: id ,
329
+ jobID: jobID ,
330
330
queueName: configuration. queueName,
331
331
options: . init( delayUntil: options. delayUntil) ,
332
332
connection: connection
@@ -488,15 +488,15 @@ public final class PostgresJobQueue: JobQueueDriver, CancellableJobQueue, Resuma
488
488
)
489
489
return try await stream. decode ( JobID . self) . first ( where: { _ in true } )
490
490
}
491
- // TODO: maybe add a new column colum for attempt so far after PR https://github.com/hummingbird-project/swift-jobs/pull/63 is merged?
492
- func updateJob( id : JobID , buffer: ByteBuffer , connection: PostgresConnection ) async throws {
491
+
492
+ func updateJob( jobID : JobID , buffer: ByteBuffer , connection: PostgresConnection ) async throws {
493
493
try await connection. query (
494
494
"""
495
495
UPDATE swift_jobs.jobs
496
496
SET job = \( buffer) ,
497
497
last_modified = \( Date . now) ,
498
498
status = \( Status . failed)
499
- WHERE id = \( id ) AND queue_name = \( configuration. queueName)
499
+ WHERE id = \( jobID ) AND queue_name = \( configuration. queueName)
500
500
""" ,
501
501
logger: self . logger
502
502
)
0 commit comments