From 7b0dd4c1c5bddff7259559662e0a477f1352f245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20CORTIER?= Date: Thu, 14 Nov 2024 13:31:59 +0900 Subject: [PATCH] . --- crates/job-queue-libsql/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/job-queue-libsql/src/lib.rs b/crates/job-queue-libsql/src/lib.rs index 147f077e..65bad6d6 100644 --- a/crates/job-queue-libsql/src/lib.rs +++ b/crates/job-queue-libsql/src/lib.rs @@ -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()); @@ -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