Skip to content

Commit

Permalink
Bump up cron refresher velocity
Browse files Browse the repository at this point in the history
  • Loading branch information
jmduke committed Oct 3, 2024
1 parent f356941 commit a762968
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/api/crons/refresh/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down

0 comments on commit a762968

Please sign in to comment.