From 993c0782b2134e66f54c3342bb55765851066e0a Mon Sep 17 00:00:00 2001 From: casulit Date: Wed, 30 Oct 2024 08:12:36 +0800 Subject: [PATCH] refactor(config): Clarify logs and adjust control flow in listenQueue --- config/deno-kv.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config/deno-kv.ts b/config/deno-kv.ts index 664e984..af04994 100644 --- a/config/deno-kv.ts +++ b/config/deno-kv.ts @@ -363,7 +363,7 @@ export async function listenQueue(kv: Deno.Kv) { }); if (listingByUrl.rowCount && listingByUrl.rowCount > 0) { - console.info("Listing already exists"); + console.info("Listing query by url already exists"); const updateListingResult = await transaction.queryObject({ args: [ @@ -439,7 +439,9 @@ export async function listenQueue(kv: Deno.Kv) { }); if (listingByTitle.rowCount && listingByTitle.rowCount > 0) { - continue; + await transaction.commit() + console.log("Listing query by title already exists") + return; } let property;