export async function loadCache()

in site/src/buildtime/fetchFusionDocFromGithub/index.ts [13:28]


export async function loadCache() {
  try {
    const str = await readFileAsync(CACHE_PATH, 'utf8')
    return JSON.parse(str)
  } catch (error) {
    if (error.code === 'ENOENT') {
      if (!updatingCache) {
        console.log(`Can't find cache for fusion docs locally.
        Now fetch fusion docs from github...`)
        updatingCache = updateAllCache()
      }
      return await updatingCache
    }
    throw error
  }
}