Skip to content

Commit

Permalink
refactor: Use transaction object for DB queries in listenQueue
Browse files Browse the repository at this point in the history
  • Loading branch information
csulit committed Oct 30, 2024
1 parent dbd53f6 commit 0284b7f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions config/deno-kv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 0284b7f

Please sign in to comment.