Skip to content

Commit cfe9e2e

Browse files
committed
use retry func from swift-jobs
1 parent 895122b commit cfe9e2e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Sources/JobsPostgres/PostgresJobsQueue.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,11 @@ public final class PostgresJobQueue: JobQueueDriver {
173173
}
174174
}
175175

176-
@discardableResult public func update(_ id: JobID, buffer: ByteBuffer, options: JobOptions) async throws -> Bool {
176+
/// Retry a job
177+
/// - Returns: Bool
178+
@discardableResult public func retry(_ id: JobID, buffer: ByteBuffer, options: JobOptions) async throws -> Bool {
177179
try await self.client.withTransaction(logger: self.logger) { connection in
178-
try await self.update(id: id, buffer: buffer, connection: connection)
180+
try await self.updateJob(id: id, buffer: buffer, connection: connection)
179181
try await self.updateQueue(jobId: id, connection: connection, delayUntil: options.delayUntil)
180182
}
181183
return true
@@ -303,8 +305,8 @@ public final class PostgresJobQueue: JobQueueDriver {
303305
logger: self.logger
304306
)
305307
}
306-
/// TODO maybe add a new column colum for attempt so far after PR https://github.com/hummingbird-project/swift-jobs/pull/63 is merged?
307-
func update(id: JobID, buffer: ByteBuffer, connection: PostgresConnection) async throws {
308+
// TODO: maybe add a new column colum for attempt so far after PR https://github.com/hummingbird-project/swift-jobs/pull/63 is merged?
309+
func updateJob(id: JobID, buffer: ByteBuffer, connection: PostgresConnection) async throws {
308310
try await connection.query(
309311
"""
310312
UPDATE _hb_pg_jobs

0 commit comments

Comments
 (0)