From 0284b7ffbecb51d3ae54c69bc055c9ec02a04958 Mon Sep 17 00:00:00 2001 From: casulit Date: Wed, 30 Oct 2024 09:31:03 +0800 Subject: [PATCH] refactor: Use transaction object for DB queries in listenQueue --- config/deno-kv.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/deno-kv.ts b/config/deno-kv.ts index 0176582..0aa080c 100644 --- a/config/deno-kv.ts +++ b/config/deno-kv.ts @@ -222,7 +222,7 @@ export async function listenQueue(kv: Deno.Kv) { const newRegionId = lastRegionId.rows[0].id + Math.floor(100000 + Math.random() * 900000); - region = await client2.queryObject({ + region = await transaction.queryObject({ args: [ newRegionId, rawProperty.region, @@ -257,7 +257,7 @@ export async function listenQueue(kv: Deno.Kv) { const newCityId = lastCityId.rows[0].id + Math.floor(100000 + Math.random() * 900000); - city = await client2.queryObject({ + city = await transaction.queryObject({ args: [ newCityId, rawProperty.city, @@ -289,7 +289,7 @@ export async function listenQueue(kv: Deno.Kv) { const newAreaId = lastAreaId.rows[0].id + Math.floor(100000 + Math.random() * 900000); - area = await client2.queryObject({ + area = await transaction.queryObject({ args: [ newAreaId, rawProperty.listing_area,