@oss-autopilot/core - v1.6.3
    Preparing search index...

    Function cachedRequest

    • Wraps an Octokit repos.get-style call with ETag caching and request deduplication.

      Usage:

      const data = await cachedRequest(cache, octokit, '/repos/owner/repo', () =>
      octokit.repos.get({ owner, repo: name }),
      );
      1. If an identical request is already in-flight, returns the existing promise (request deduplication).
      2. If a cached ETag exists, sends If-None-Match. On 304, returns the cached body without consuming a rate-limit point.
      3. On a fresh 200, caches the ETag + body for next time.

      Type Parameters

      • T

      Parameters

      • cache: HttpCache
      • url: string
      • fetcher: (
            headers: Record<string, string>,
        ) => Promise<{ data: T; headers?: Record<string, string> }>

      Returns Promise<T>