@@ -11,18 +11,14 @@ import { getStatus } from "../../status";
1111import { PublisherIcon } from "../PublisherIcon" ;
1212import { PublisherTag } from "../PublisherTag" ;
1313import { PublishersCard } from "./publishers-card" ;
14+ import { funcA , funcAUnstableCache } from "./util" ;
1415
1516type Props = {
1617 params : Promise < {
1718 slug : string ;
1819 } > ;
1920} ;
2021
21- const funcA = async ( ) => {
22- "use cache" ;
23- await new Promise ( ( resolve ) => setTimeout ( resolve , 2000 ) ) ;
24- return Math . random ( ) ;
25- }
2622
2723const funcB = async ( ) => {
2824 const start = performance . now ( ) ;
@@ -33,6 +29,14 @@ const funcB = async () => {
3329 return res ;
3430}
3531
32+ const funcBUnstableCache = async ( ) => {
33+ const start = performance . now ( ) ;
34+ const res = await funcAUnstableCache ( ) ;
35+ const end = performance . now ( ) ;
36+ // eslint-disable-next-line no-console, @typescript-eslint/restrict-template-expressions
37+ console . log ( `funcBUnstableCache: ${ end - start } ms` ) ;
38+ return res ;
39+ }
3640
3741export const Publishers = async ( { params } : Props ) => {
3842 const { slug } = await params ;
@@ -42,13 +46,19 @@ export const Publishers = async ({ params }: Props) => {
4246 pythtestConformanceFeeds ,
4347 pythnetPublishers ,
4448 pythtestConformancePublishers ,
49+ funcRes ,
50+ funcResUnstableCache ,
4551 ] = await Promise . all ( [
4652 getFeedsCached ( Cluster . Pythnet ) ,
4753 getFeedsCached ( Cluster . PythtestConformance ) ,
4854 getPublishers ( Cluster . Pythnet , symbol ) ,
4955 getPublishers ( Cluster . PythtestConformance , symbol ) ,
5056 funcB ( ) ,
57+ funcBUnstableCache ( ) ,
5158 ] ) ;
59+
60+ // eslint-disable-next-line no-console, @typescript-eslint/restrict-template-expressions
61+ console . log ( funcRes , funcResUnstableCache ) ;
5262 const feed = pythnetFeeds . find ( ( feed ) => feed . symbol === symbol ) ;
5363 const testFeed = pythtestConformanceFeeds . find (
5464 ( feed ) => feed . symbol === symbol ,
0 commit comments