@studyportals/fawkes 8.7.2-23 → 8.7.2-25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,18 +21,24 @@ export class RankedCountryDiscipline extends RankedOrganisationsSeoIndexabilityP
21
21
  const countryFragments = CountryPresenter.getInstance().getFragments();
22
22
  const disciplineFragments = DisciplinePresenter.getInstance().getFragments();
23
23
  const paths = [];
24
- // Process sequentially to respect API rate limits
25
- for (const country of countryFragments) {
26
- for (const discipline of disciplineFragments) {
24
+ const concurrencyLimit = 10; // Process 10 combinations concurrently
25
+ // Create all combinations
26
+ const combinations = countryFragments.flatMap(country => disciplineFragments.map(discipline => ({ country, discipline })));
27
+ // Process in batches to respect API rate limits
28
+ for (let i = 0; i < combinations.length; i += concurrencyLimit) {
29
+ const batch = combinations.slice(i, i + concurrencyLimit);
30
+ const results = await Promise.all(batch.map(async ({ country, discipline }) => {
27
31
  const filterKeyValues = new Map([
28
32
  [FilterKey.COUNTRY, [country.id]],
29
33
  [FilterKey.DISCIPLINES, [discipline.id]]
30
34
  ]);
31
35
  const result = await this.checkRulesForSitemap(filterKeyValues);
32
36
  if (result) {
33
- paths.push(this.getPathWithSortingOption(`${country.path}/${discipline.path}`));
37
+ return this.getPathWithSortingOption(`${country.path}/${discipline.path}`);
34
38
  }
35
- }
39
+ return null;
40
+ }));
41
+ paths.push(...results.filter((path) => path !== null));
36
42
  }
37
43
  return paths;
38
44
  }
@@ -18,19 +18,8 @@ export class MinimumAmountOfRankedResultsRule {
18
18
  const filterKeys = [...filterKeyValues.keys()];
19
19
  throw new DependencyMissingError(`CountwithRankings ${filterKeys.join(',')}`);
20
20
  }
21
- // eslint-disable-next-line no-console
22
- console.debug('MinimumAmountOfRankedResultsRule: Checking ranked results count for filterKeyValues:', filterKeyValues);
23
- try {
24
- const rankedResultsCount = await this.searchApiClient.getCountWithRankings(filterKeyValues);
25
- // eslint-disable-next-line no-console
26
- console.debug('MinimumAmountOfRankedResultsRule: Ranked results count:', rankedResultsCount);
27
- return rankedResultsCount >= this.minimumRankedResultsCount;
28
- }
29
- catch (error) {
30
- // eslint-disable-next-line no-console
31
- console.error('MinimumAmountOfRankedResultsRule: API call failed:', error);
32
- throw error;
33
- }
21
+ const rankedResultsCount = await this.searchApiClient.getCountWithRankings(filterKeyValues);
22
+ return rankedResultsCount >= this.minimumRankedResultsCount;
34
23
  }
35
24
  getName() {
36
25
  return 'AtLeastFourRankedResultsRule';
@@ -17,7 +17,6 @@ export class BaseSitemapUrlGeneratorManager {
17
17
  for (const presenter of this.presenters.values()) {
18
18
  const count = presenter.getFragments().length;
19
19
  this.filterKeyValueCounts.set(presenter.filterKey, count);
20
- console.debug(`Set filter key value count for ${presenter.filterKey}: ${count}`); // eslint-disable-line no-console
21
20
  }
22
21
  }
23
22
  getPolicies() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studyportals/fawkes",
3
- "version": "8.7.2-23",
3
+ "version": "8.7.2-25",
4
4
  "description": "A package to centralize SEO related logic for SBLP and Sitemap Generator.",
5
5
  "files": [
6
6
  "./dist"