From 1e616342db4d32791774fea97dd066082a7a3c25 Mon Sep 17 00:00:00 2001 From: casulit Date: Fri, 1 Nov 2024 18:43:37 +0800 Subject: [PATCH] refactor(config): Simplify SQL query conditions in listenQueue --- config/deno-kv.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/deno-kv.ts b/config/deno-kv.ts index 89e6b78..ef9b72a 100644 --- a/config/deno-kv.ts +++ b/config/deno-kv.ts @@ -138,7 +138,7 @@ export async function listenQueue(kv: Deno.Kv) { text: ` SELECT COUNT(*) FROM lamudi_raw_data - WHERE is_process = FALSE AND price_not_shown_is_process = FALSE + WHERE is_process = FALSE `, }); @@ -194,7 +194,7 @@ export async function listenQueue(kv: Deno.Kv) { CONCAT('https://lamudi.com.ph/', json_data->'dataLayer'->'attributes'->>'urlkey_details') AS full_url, (json_data->>'images')::jsonb AS images FROM lamudi_raw_data - WHERE is_process = FALSE AND price_not_shown_is_process = FALSE + WHERE is_process = FALSE AND COALESCE((json_data->'dataLayer'->'attributes'->>'price')::BIGINT, 0) > 5000 AND json_data->'dataLayer'->'location'->>'region' IS NOT NULL AND json_data->'dataLayer'->'location'->>'city' IS NOT NULL