From a762968f4d1c8d456319df021de44ecf28334285 Mon Sep 17 00:00:00 2001 From: Justin Duke Date: Thu, 3 Oct 2024 14:56:30 -0400 Subject: [PATCH] Bump up cron refresher velocity --- app/api/crons/refresh/route.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/api/crons/refresh/route.ts b/app/api/crons/refresh/route.ts index 1021d91..6db996b 100644 --- a/app/api/crons/refresh/route.ts +++ b/app/api/crons/refresh/route.ts @@ -8,12 +8,18 @@ const logger = pino({ name: "cron-refresh", }); +// Without this comment, Next.js will cache the response +// and therefore this endpoint does not do anything. (I really wish +// we had a simpler way to trigger and manage these; might be worth looking +// into Trigger at some point.) export const revalidate = 0; +// This `sample` is a cute trick to get a random sample of domains without +// having to do a full table scan. const RAW_QUERY = sql<{ domain: string; }>` - select domain from tranco TABLESAMPLE system (0.01) + select domain from tranco TABLESAMPLE system (0.02) `; const getRandomDomains = async () => {