From 575a546382695e13911c42d7db3e196c993e97ca Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Tue, 26 Nov 2024 00:19:20 +0100 Subject: [PATCH] fixed the prepared --- ...6092e999001e07af811afed672ab35dae0724d7e2bd129c13b3d.json} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename server/.sqlx/{query-cba5d0c110a8945eef84af8381dacd216add69ed835ba1bb75e433c66f25e1b0.json => query-9fb457eebb8c6092e999001e07af811afed672ab35dae0724d7e2bd129c13b3d.json} (76%) diff --git a/server/.sqlx/query-cba5d0c110a8945eef84af8381dacd216add69ed835ba1bb75e433c66f25e1b0.json b/server/.sqlx/query-9fb457eebb8c6092e999001e07af811afed672ab35dae0724d7e2bd129c13b3d.json similarity index 76% rename from server/.sqlx/query-cba5d0c110a8945eef84af8381dacd216add69ed835ba1bb75e433c66f25e1b0.json rename to server/.sqlx/query-9fb457eebb8c6092e999001e07af811afed672ab35dae0724d7e2bd129c13b3d.json index 833d9062f..e7132ddb5 100644 --- a/server/.sqlx/query-cba5d0c110a8945eef84af8381dacd216add69ed835ba1bb75e433c66f25e1b0.json +++ b/server/.sqlx/query-9fb457eebb8c6092e999001e07af811afed672ab35dae0724d7e2bd129c13b3d.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\nWITH ENTRIES_TO_SCRAPE AS (SELECT KEY,\n CASE WHEN last_calendar_scrape_at IS NULL THEN 100 ELSE 1 END AS boost_if_never_scraped,\n CAST(data -> 'ranking_factors' ->> 'rank_combined' AS INTEGER) AS rank_combined,\n (LAST_CALENDAR_SCRAPE_AT < DATE_SUBTRACT(NOW(), '60 minutes'::INTERVAL, 'Europe/Berlin')\n OR LAST_CALENDAR_SCRAPE_AT IS NULL) AS would_need_scraping,\n EXTRACT(EPOCH FROM (NOW() - LAST_CALENDAR_SCRAPE_AT)) AS seconds_ago,\n CALENDAR_URL IS NOT NULL AS can_be_scraped\n FROM de)\n\nSELECT key\nFROM entries_to_scrape\nWHERE would_need_scraping AND can_be_scraped\n-- boost_if_never_scraped: has this ever been scraped? => give a good bonusd\n-- rank_combined: \"how important is this room?\" (range 1..1k)\n-- seconds_ago: \"how long since we last scraped it?\" (range null,30*60/3=600..)\nORDER BY boost_if_never_scraped * rank_combined * coalesce(seconds_ago/6,1) DESC\nLIMIT 30", + "query": "\nWITH ENTRIES_TO_SCRAPE AS (SELECT KEY,\n CASE WHEN last_calendar_scrape_at IS NULL THEN 100 ELSE 1 END AS boost_if_never_scraped,\n CAST(data -> 'ranking_factors' ->> 'rank_combined' AS INTEGER) AS rank_combined,\n (LAST_CALENDAR_SCRAPE_AT < DATE_SUBTRACT(NOW(), '60 minutes'::INTERVAL, 'Europe/Berlin')\n OR LAST_CALENDAR_SCRAPE_AT IS NULL) AS would_need_scraping,\n EXTRACT(EPOCH FROM (NOW() - LAST_CALENDAR_SCRAPE_AT)) AS seconds_ago,\n CALENDAR_URL IS NOT NULL AS can_be_scraped\n FROM de)\n\nSELECT key\nFROM entries_to_scrape\nWHERE would_need_scraping AND can_be_scraped\n-- boost_if_never_scraped: has this ever been scraped? => give a good bonus\n-- rank_combined: \"how important is this room?\" (range 1..1k)\n-- seconds_ago: \"how long since we last scraped it?\" (range null,30*60/3=600..)\nORDER BY boost_if_never_scraped * rank_combined * coalesce(seconds_ago/6,1) DESC\nLIMIT 30", "describe": { "columns": [ { @@ -16,5 +16,5 @@ false ] }, - "hash": "cba5d0c110a8945eef84af8381dacd216add69ed835ba1bb75e433c66f25e1b0" + "hash": "9fb457eebb8c6092e999001e07af811afed672ab35dae0724d7e2bd129c13b3d" }