File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -219,6 +219,7 @@ export class GitHubCache {
219219 * 2. calls the promise to get new data if no value is found in cache
220220 * 3. store this new value back in the cache with an optional TTL before returning the value.
221221 *
222+ * @returns a currying promise than handles everything needed for requests
222223 * @private
223224 */
224225 #processCached< RType extends Parameters < InstanceType < typeof Redis > [ "json" ] [ "set" ] > [ 2 ] > ( ) {
@@ -782,15 +783,11 @@ export class GitHubCache {
782783 this . #getRepoKey( owner , repo , "discussions" ) ,
783784 async ( ) => {
784785 try {
785- const { data : discussions } = await this . #octokit. request (
786- "GET /repos/{owner}/{repo}/discussions" ,
787- {
788- owner,
789- repo,
790- per_page
791- }
792- ) ;
793- return discussions ;
786+ return await this . #octokit. paginate < Discussion > ( "GET /repos/{owner}/{repo}/discussions" , {
787+ owner,
788+ repo,
789+ per_page
790+ } ) ;
794791 } catch {
795792 return [ ] as Discussion [ ] ;
796793 }
You can’t perform that action at this time.
0 commit comments