Skip to content

Commit 9859a73

Browse files
committed
Swift format
1 parent eddd61e commit 9859a73

File tree

2 files changed

+17
-22
lines changed

2 files changed

+17
-22
lines changed

Sources/JobsPostgres/PostgresJobsQueue.swift

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -271,28 +271,24 @@ public final class PostgresJobQueue: JobQueueDriver {
271271
/// - action Job Action
272272
public func performAction(jobID: JobID, action: JobAction) async throws {
273273
switch action {
274-
case .cancel():
275-
try await self.performJobAction(jobID: jobID, status: .cancelled)
276-
case .pause():
277-
try await self.performJobAction(jobID: jobID, status: .paused)
278-
case .resume():
279-
try await self.client.withTransaction(logger: logger) { connection in
280-
try await self.setStatus(jobID: jobID, status: .pending, connection: connection)
281-
try await self.addToQueue(
282-
jobID: jobID,
283-
queueName: configuration.queueName,
284-
options: .init(),
285-
connection: connection
286-
)
287-
}
288-
default:
289-
break
274+
case .cancel():
275+
try await self.performJobAction(jobID: jobID, status: .cancelled)
276+
case .pause():
277+
try await self.performJobAction(jobID: jobID, status: .paused)
278+
case .resume():
279+
try await self.client.withTransaction(logger: logger) { connection in
280+
try await self.setStatus(jobID: jobID, status: .pending, connection: connection)
281+
try await self.addToQueue(
282+
jobID: jobID,
283+
queueName: configuration.queueName,
284+
options: .init(),
285+
connection: connection
286+
)
287+
}
288+
default:
289+
break
290290
}
291291
}
292-
293-
public func isEmpty() async throws -> Bool {
294-
true
295-
}
296292

297293
/// This is called to say job has finished processing and it can be deleted
298294
public func finished(jobID: JobID) async throws {
@@ -518,7 +514,6 @@ public final class PostgresJobQueue: JobQueueDriver {
518514

519515
func performJobAction(jobID: JobID, status: Status) async throws {
520516
try await self.client.withTransaction(logger: logger) { connection in
521-
522517
try await connection.query(
523518
"""
524519
DELETE FROM swift_jobs.queues

Tests/JobsPostgresTests/JobsTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ final class JobsTests: XCTestCase {
683683
group.cancelAll()
684684
}
685685
}
686-
686+
687687
func testJobActions() async throws {
688688
struct TestParameters: JobParameters {
689689
static let jobName = "testJobActions"

0 commit comments

Comments
 (0)