Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix race condition between set() and push() #14

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ jobs:
fail-fast: false
matrix:
include:
- macos-version: macos-13
xcode-version: '~15.2'
- macos-version: macos-14
xcode-version: latest-stable
- macos-version: macos-15
xcode-version: latest-stable
runs-on: ${{ matrix.macos-version }}
timeout-minutes: 60
steps:
Expand Down
2 changes: 1 addition & 1 deletion Sources/QueuesFluentDriver/FluentQueue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public struct FluentQueue: AsyncQueue, Sendable {
.bind(jobStorage.jobName),
.bind(jobStorage.queuedAt),
.bind(jobStorage.delayUntil),
.literal(StoredJobState.pending),
.literal(StoredJobState.initial),
.bind(jobStorage.maxRetryCount),
.bind(jobStorage.attempts),
.bind(Data(jobStorage.payload)),
Expand Down
3 changes: 3 additions & 0 deletions Sources/QueuesFluentDriver/JobModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import struct Queues.QueueName

/// The state of a job currently stored in the database.
enum StoredJobState: String, Codable, CaseIterable {
/// Job has been set up but is not yet ready to execute.
case initial

/// Job is ready to be picked up for execution.
case pending

Expand Down
Loading