Address review feedback
- Move getOwnServiceCredentials() before the pagination loop in DefaultTechDocsCollatorFactory - Fix stale test comment that referenced the deleted MSW /entities handler Signed-off-by: Fredrik Adelöw <freben@spotify.com> Made-with: Cursor
This commit is contained in:
+3
-3
@@ -186,9 +186,9 @@ describe('DefaultTechDocsCollatorFactory', () => {
|
||||
});
|
||||
|
||||
it('paginates through catalog entities using batchSize', async () => {
|
||||
// A parallelismLimit of 1 is a catalog limit of 50 per request. Code
|
||||
// above in the /entities handler ensures valid entities are only
|
||||
// returned on the second page.
|
||||
// A parallelismLimit of 1 results in a batchSize of 50 per request.
|
||||
// The catalog returns fewer entities than the batchSize, so the loop
|
||||
// exits after a single page, producing 3 documents (1 entity × 3 search index docs).
|
||||
const _config = new ConfigReader({
|
||||
...config.get(),
|
||||
search: {
|
||||
|
||||
+1
-2
@@ -143,9 +143,8 @@ export class DefaultTechDocsCollatorFactory implements DocumentCollatorFactory {
|
||||
// at index-time. The batchSize is calculated as a factor of the given
|
||||
// parallelism limit to simplify configuration.
|
||||
const batchSize = this.parallelismLimit * 50;
|
||||
const credentials = await this.auth.getOwnServiceCredentials();
|
||||
while (moreEntitiesToGet) {
|
||||
const credentials = await this.auth.getOwnServiceCredentials();
|
||||
|
||||
const entities = (
|
||||
await this.catalog.getEntities(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user