File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,10 @@ import * as types from './types'
6
6
import { includeNotionIdInUrls } from './config'
7
7
import { getCanonicalPageId } from './get-canonical-page-id'
8
8
import { notion } from './notion-api'
9
+ import ExpiryMap from 'expiry-map'
9
10
10
11
const uuid = ! ! includeNotionIdInUrls
12
+ const cache = new ExpiryMap ( 10000 )
11
13
12
14
export async function getSiteMap ( ) : Promise < types . SiteMap > {
13
15
const partialSiteMap = await getAllPages (
@@ -22,7 +24,8 @@ export async function getSiteMap(): Promise<types.SiteMap> {
22
24
}
23
25
24
26
const getAllPages = pMemoize ( getAllPagesImpl , {
25
- cacheKey : ( ...args ) => JSON . stringify ( args )
27
+ cacheKey : ( ...args ) => JSON . stringify ( args ) ,
28
+ cache
26
29
} )
27
30
28
31
async function getAllPagesImpl (
You can’t perform that action at this time.
0 commit comments