Skip to content

Commit 3823e64

Browse files
committed
fix: cache key issue
1 parent 022793b commit 3823e64

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ type Props = {
2222
export const Publishers = async ({ params }: Props) => {
2323
const { slug } = await params;
2424
const symbol = decodeURIComponent(slug);
25+
const start = Date.now();
2526
const [
2627
pythnetFeeds,
2728
pythtestConformanceFeeds,
@@ -33,6 +34,9 @@ export const Publishers = async ({ params }: Props) => {
3334
getPublishers(Cluster.Pythnet, symbol),
3435
getPublishers(Cluster.PythtestConformance, symbol),
3536
]);
37+
const end = Date.now();
38+
// eslint-disable-next-line no-console
39+
console.info(`Publishers took ${(end - start).toString()}ms`);
3640
const feed = pythnetFeeds.find((feed) => feed.symbol === symbol);
3741
const testFeed = pythtestConformanceFeeds.find(
3842
(feed) => feed.symbol === symbol,

apps/insights/src/server/clickhouse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ const _getPublishers = createChunkedCacheFetcher(async (cluster: Cluster) => {
4242

4343
export const getPublishersCached = async (cluster: Cluster) => {
4444
return fetchAllChunks<ReturnType<typeof getPublishers>, [Cluster]>(_getPublishers, cluster);
45-
};
45+
}

apps/insights/src/server/pyth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const fetchPublishers = createChunkedCacheFetcher(async (cluster: Cluster) => {
6060
result[key] = price?.priceComponents.map(({ publisher }) => publisher.toBase58()) ?? [];
6161
}
6262
return result;
63-
}, 'getPublishers');
63+
}, 'fetchPublishers');
6464

6565
export const getFeedsCached = async (cluster: Cluster) => {
6666
return fetchAllChunks<z.infer<typeof priceFeedsSchema>, [Cluster]>(fetchFeeds, cluster)

0 commit comments

Comments
 (0)