Skip to content

fix(insights): remove data caching & pregeneration, add revalidate #2320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/insights/src/app/layout.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
export { Root as default } from "../components/Root";
export { metadata, viewport } from "../metadata";

export const revalidate = 3600;
6 changes: 1 addition & 5 deletions apps/insights/src/app/price-feeds/[slug]/layout.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import type { Metadata } from "next";

import { Cluster, getFeeds } from "../../../services/pyth";
export { PriceFeedLayout as default } from "../../../components/PriceFeed/layout";

export const metadata: Metadata = {
title: "Price Feeds",
};

export const generateStaticParams = async () => {
const feeds = await getFeeds(Cluster.Pythnet);
return feeds.map(({ symbol }) => ({ slug: encodeURIComponent(symbol) }));
};
export const revalidate = 3600;
2 changes: 2 additions & 0 deletions apps/insights/src/app/price-feeds/[slug]/page.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export { ChartPage as default } from "../../../components/PriceFeed/chart-page";

export const revalidate = 3600;
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export { Publishers as default } from "../../../../components/PriceFeed/publishers";

export const revalidate = 3600;
2 changes: 2 additions & 0 deletions apps/insights/src/app/price-feeds/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ export { PriceFeeds as default } from "../../components/PriceFeeds";
export const metadata: Metadata = {
title: "Price Feeds",
};

export const revalidate = 3600;
6 changes: 1 addition & 5 deletions apps/insights/src/app/publishers/[key]/layout.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import type { Metadata } from "next";

export { PublishersLayout as default } from "../../../components/Publisher/layout";
import { getPublishers } from "../../../services/clickhouse";

export const metadata: Metadata = {
title: "Publishers",
};

export const generateStaticParams = async () => {
const publishers = await getPublishers();
return publishers.map(({ key }) => ({ key }));
};
export const revalidate = 3600;
2 changes: 2 additions & 0 deletions apps/insights/src/app/publishers/[key]/page.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export { Performance as default } from "../../../components/Publisher/performance";

export const revalidate = 3600;
2 changes: 2 additions & 0 deletions apps/insights/src/app/publishers/[key]/price-feeds/page.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export { PriceFeeds as default } from "../../../../components/Publisher/price-feeds";

export const revalidate = 3600;
2 changes: 2 additions & 0 deletions apps/insights/src/app/publishers/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ export { Publishers as default } from "../../components/Publishers";
export const metadata: Metadata = {
title: "Publishers",
};

export const revalidate = 3600;
16 changes: 0 additions & 16 deletions apps/insights/src/cache.ts

This file was deleted.

Loading
Loading