Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
chore: Add comment on SKIP LOCKED clause
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasfarias committed Nov 30, 2023
1 parent ec6ba09 commit c6ab642
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hook-common/src/pgqueue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ impl PgQueue {
pub async fn dequeue<J: DeserializeOwned + std::marker::Send + std::marker::Unpin + 'static>(
&self,
) -> PgQueueResult<Job<J>> {
// The query that follows uses a FOR UPDATE SKIP LOCKED clause.
// For more details on this see: 2ndquadrant.com/en/blog/what-is-select-skip-locked-for-in-postgresql-9-5.
let base_query = format!(
r#"
WITH available_in_queue AS (
Expand Down

0 comments on commit c6ab642

Please sign in to comment.