Skip to content

Commit

Permalink
refactor(config): Ensure transaction wraps property updates in deno-kv
Browse files Browse the repository at this point in the history
  • Loading branch information
csulit committed Oct 25, 2024
1 parent deb8dc8 commit 7f6e850
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/deno-kv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -496,10 +496,12 @@ export async function listenQueue(kv: Deno.Kv) {

// Update all processed properties in transaction
for (const prop of processedProperty) {
await transaction.begin();
await transaction.queryObject({
args: [prop.ai_generated_description, prop.id],
text: `UPDATE Property SET ai_generated_description = $1 WHERE id = $2`,
});
await transaction.commit();
}
}

Expand Down

0 comments on commit 7f6e850

Please sign in to comment.