( account: Account, type: APIClientType, )
| 51 | * @returns A cached authenticated Octokit instance |
| 52 | */ |
| 53 | export async function createOctokitClient( |
| 54 | account: Account, |
| 55 | type: APIClientType, |
| 56 | ): Promise<OctokitClient> { |
| 57 | const cacheKey = getClientCacheKey(account, type); |
| 58 | |
| 59 | // Return cached client if it exists |
| 60 | const cachedClient = octokitClientCache.get(cacheKey); |
| 61 | if (cachedClient) { |
| 62 | return cachedClient; |
| 63 | } |
| 64 | |
| 65 | const client = await createOctokitClientUncached(account, type); |
| 66 | octokitClientCache.set(cacheKey, client); |
| 67 | |
| 68 | return client; |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | * Create an authenticated Octokit client instance without caching |
no test coverage detected