Skip to content
Closed
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
11 changes: 11 additions & 0 deletions migrations/20250212120000_4.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- Force anything running this migration to use the right search path.
set local search_path to underway;

alter table underway.task
add column if not exists lease_token uuid;

alter table underway.task
add column if not exists lease_expires_at timestamp with time zone;

alter table underway.task_attempt
add column if not exists lease_token uuid;
8 changes: 4 additions & 4 deletions src/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,9 +652,7 @@ use uuid::Uuid;
use crate::{
queue::{Error as QueueError, InProgressTask, Queue},
scheduler::{Error as SchedulerError, Scheduler, ZonedSchedule},
task::{
Error as TaskError, Result as TaskResult, RetryPolicy, State as TaskState, Task, TaskId,
},
task::{Error as TaskError, Result as TaskResult, RetryPolicy, State as TaskState, Task},
worker::{Error as WorkerError, Worker},
};

Expand Down Expand Up @@ -917,7 +915,9 @@ impl<T: Task> EnqueuedJob<T> {
retry_policy as "retry_policy: RetryPolicy",
timeout,
heartbeat,
concurrency_key
concurrency_key,
0::int as "attempt_number!",
lease_token as "lease_token?"
from underway.task
where input->>'job_id' = $1
and state = $2
Expand Down
Loading
Loading