Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
CBenoit committed Nov 14, 2024
1 parent b1d96d3 commit 7b0dd4c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/job-queue-libsql/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ impl JobQueue for LibSqlJobQueue {
VALUES (:id, :instance_id, :failed_attempts, :status, :name, jsonb(:def))";

// UUID v4 provides no other information than randomness which cause fragmentation.
// Reduce index fragmentation due by using ULID instead.
// Reduce index fragmentation by using ULID instead.
// https://github.com/ulid/spec
let id = Uuid::from(Ulid::new());

Expand Down Expand Up @@ -190,10 +190,10 @@ impl JobQueue for LibSqlJobQueue {
let number_of_jobs = u32::try_from(number_of_jobs).context("number_of_jobs is too big")?;

// If we were using Postgres, we would need to use `FOR UPDATE SKIP LOCKED`
// in the SQL query to avoid blocking other readers.
// in the SQL query to avoid blocking other readers/writers.
// For MySQL, this would be `FOR UPDATE NOWAIT`
// However, in SQLite / libSQL, there is only a single writer at a time.
// As such, this directive doesn't exist.
// For MySQL, this would be `FOR UPDATE NOWAIT`

let sql_query = "UPDATE job_queue
SET status = :new_status
Expand Down

0 comments on commit 7b0dd4c

Please sign in to comment.