#Set entity refresh interval with new backend system to avoid rate limit

1 messages · Page 1 of 1 (latest)

solemn gyro
#

We recently upgraded to from Backstage 1.20 to 1.25 and migrated the plugins to the new backend system.

Prior to the update, we were using the following to avoid rate limits for our (fairly) large Github org:

// packages/backend/src/plugins/catalog.ts

// https://backstage.io/docs/integrations/github/discovery/#github-api-rate-limits
const builder = await CatalogBuilder.create(env);

// Only refresh every 4 hour
builder.setProcessingIntervalSeconds(14400); // <---------------- How do we specify this?

builder.addEntityProvider(
GithubEntityProvider.fromConfig(env.config, {
logger: env.logger,
scheduler: env.scheduler,
}),
GithubOrgEntityProvider.fromConfig(env.config, {
id: '...',
orgUrl: '...',
logger: env.logger,
schedule: env.scheduler.createScheduledTaskRunner({
frequency: { minutes: 1440 },
timeout: { minutes: 15 },
}),
}),
);

and our providers

// app-config.yaml
providers:
github:
orgIdMaster:
organization: '...'
catalogPath: '/catalog-info.yaml'
filters:
branch: 'master'
repository: '.*'
schedule:
frequency:
minutes: 360
timeout: {minutes: 15}

But now with packages/backend/src/plugins/catalog.ts gone, how do we specify the setProcessingIntervalSeconds?

Since the update, we've been hitting the rate limit every hour or so. The entity refresh (according to the database) is around 100s.

Automatically discovering catalog entities from repositories in a GitHub organization