Skip to content

Commit

Permalink
provide queue name in dequeue update
Browse files Browse the repository at this point in the history
While this is not technically required, since the CTE has already
filtered with the name, it's nonetheless more clear regarding the intent
and underlying data model at play.
  • Loading branch information
maxcountryman committed Nov 16, 2024
1 parent bf627cd commit d8dc087
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions src/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -694,15 +694,16 @@ impl<T: Task> Queue<T> {
last_attempt_at = now(),
last_heartbeat_at = now()
from available_task
where t.id = available_task.id
where t.task_queue_name = $1
and t.id = available_task.id
returning
t.id as "id: TaskId",
task_queue_name as "queue_name",
input,
timeout,
heartbeat,
retry_policy as "retry_policy: RetryPolicy",
concurrency_key
t.task_queue_name as "queue_name",
t.input,
t.timeout,
t.heartbeat,
t.retry_policy as "retry_policy: RetryPolicy",
t.concurrency_key
"#,
self.name,
TaskState::Pending as TaskState,
Expand Down

0 comments on commit d8dc087

Please sign in to comment.