Skip to content

Commit

Permalink
fix(config): Handle error by setting is_process flag in Deno KV listener
Browse files Browse the repository at this point in the history
  • Loading branch information
csulit committed Oct 29, 2024
1 parent c3f691f commit 9e094eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions config/deno-kv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,14 @@ export async function listenQueue(kv: Deno.Kv) {
console.info("1 record updated in lamudi_raw_data");
}
} catch (error) {
await client2.queryObject({
args: [rawProperty.id],
text: `
UPDATE lamudi_raw_data
SET is_process = TRUE
WHERE id = $1
`,
});
throw error;
}
}
Expand Down
2 changes: 1 addition & 1 deletion server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ app.get("/api/properties", async (c: Context) => {
if (query.search) {
addWhereCondition(
`to_tsvector('english', l.title || ' ' || l.description) @@ plainto_tsquery($${paramCounter})`,
query.search
query.search,
);
}

Expand Down

0 comments on commit 9e094eb

Please sign in to comment.