Skip to content

Commit

Permalink
refactor: time-based revalidate in notion queries
Browse files Browse the repository at this point in the history
  • Loading branch information
leapalazzolo committed Feb 2, 2024
1 parent 1f031d2 commit 7ef010e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/notion/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ import { KudosQueryParameters } from "./types";

const notion = new Client({
auth: process.env.NOTION_API_KEY,
fetch: (url, opts) => {
return fetch(url, {
...opts,
next: { revalidate: +process.env.NOTION_CACHE_DURATION! },
});
},
});

export async function baseQueryDatabase(
Expand Down

0 comments on commit 7ef010e

Please sign in to comment.