Skip to content

Commit

Permalink
Add Paging
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Oct 30, 2024
1 parent 9bc33c4 commit da55278
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion persist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ cron.schedule('0,10,20,30,40,50 * * * * *', async () => {
});

async function globalPaths(): any {
let total = 0;
let page = -1;
let res: any;

Expand All @@ -36,8 +37,10 @@ async function globalPaths(): any {

const body = await res.json();

total = body.itemCount;

paths.push(...body.items);
} while (res.itemCount > page * 1000)
} while (total > page * 1000)

return paths;
}
Expand Down

0 comments on commit da55278

Please sign in to comment.