Skip to content

Commit 07fbd02

Browse files
committed
feat: add revalidate for contributors fetching (#430)
1 parent bf3b669 commit 07fbd02

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

pwa/api/contributors.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ export const octokit = new MyOctokit({
5555
},
5656
request: {
5757
fetch: (url: string, opts: any) => {
58-
return fetch(url, { ...opts, next: { tags: ["contributors"] } });
58+
return fetch(url, {
59+
...opts,
60+
next: { tags: ["contributors"], revalidate: 86400 },
61+
});
5962
},
6063
},
6164
});

pwa/app/(common)/community/contributors/[slug]/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ export async function generateStaticParams() {
7373
return contributors.map((c) => ({ slug: c.login }));
7474
}
7575

76+
export const revalidate = 86400;
77+
7678
export default async function Page({
7779
params: { slug },
7880
}: {

pwa/app/(common)/community/contributors/page.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ export async function generateMetadata(): Promise<Metadata> {
2121
};
2222
}
2323

24-
export const revalidate = 86400; // revalidate the contributors ranking every day
25-
2624
export default async function Page() {
2725
const contributors = await getAllContributors();
2826
return (

0 commit comments

Comments
 (0)