Skip to content

Commit 6e33dd2

Browse files
committed
feat: add more cached methods
1 parent 2e2f8bb commit 6e33dd2

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

apps/insights/src/components/PriceFeed/get-feed.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import { getFeedsCached } from "../../server/pyth";
44
import { Cluster } from "../../services/pyth";
55

66
export const getFeed = async (params: Promise<{ slug: string }>) => {
7-
"use cache";
8-
97
const [{ slug }, feeds] = await Promise.all([params, getFeedsCached(Cluster.Pythnet)]);
108
const symbol = decodeURIComponent(slug);
119
return {

apps/insights/src/components/PriceFeed/publishers.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import { lookup as lookupPublisher } from "@pythnetwork/known-publishers";
22
import { notFound } from "next/navigation";
33

4-
import { PublishersCard } from "./publishers-card";
4+
import { getRankingsBySymbolCached } from '../../server/clickhouse';
55
import { getFeedsCached, getPublishersForFeedCached } from "../../server/pyth";
6-
import { getRankingsBySymbol } from "../../services/clickhouse";
76
import {
87
Cluster,
98
ClusterToName,
109
} from "../../services/pyth";
1110
import { getStatus } from "../../status";
1211
import { PublisherIcon } from "../PublisherIcon";
1312
import { PublisherTag } from "../PublisherTag";
13+
import { PublishersCard } from "./publishers-card";
1414

1515
type Props = {
1616
params: Promise<{
@@ -87,7 +87,7 @@ export const PublishersLoading = () => <PublishersCard isLoading />;
8787
const getPublishers = async (cluster: Cluster, symbol: string) => {
8888
const [publishers, rankings] = await Promise.all([
8989
getPublishersForFeedCached(cluster, symbol),
90-
getRankingsBySymbol(symbol),
90+
getRankingsBySymbolCached(symbol),
9191
]);
9292

9393
return (
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
import { getRankingsBySymbol } from "../services/clickhouse";
3+
4+
export const getRankingsBySymbolCached = async (symbol: string) => {
5+
"use cache";
6+
return getRankingsBySymbol(symbol);
7+
};

0 commit comments

Comments
 (0)