diff --git a/.changeset/quiet-islands-learn.md b/.changeset/quiet-islands-learn.md new file mode 100644 index 0000000000..7e2ad6bdf1 --- /dev/null +++ b/.changeset/quiet-islands-learn.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend': patch +--- + +Add configuration parameters for deferred stitcher diff --git a/plugins/catalog-backend/config.d.ts b/plugins/catalog-backend/config.d.ts index 265d78b496..183607341c 100644 --- a/plugins/catalog-backend/config.d.ts +++ b/plugins/catalog-backend/config.d.ts @@ -156,6 +156,10 @@ export interface Config { | { /** Defer stitching to be performed asynchronously */ mode: 'deferred'; + /** Polling interval for tasks in seconds */ + pollingInterval?: number; + /** How long to wait for a stitch to complete before giving up in seconds */ + stitchTimeout?: number; }; /** diff --git a/plugins/catalog-backend/src/stitching/types.ts b/plugins/catalog-backend/src/stitching/types.ts index 9f7a5652dd..afeeff7335 100644 --- a/plugins/catalog-backend/src/stitching/types.ts +++ b/plugins/catalog-backend/src/stitching/types.ts @@ -66,11 +66,15 @@ export function stitchingStrategyFromConfig(config: Config): StitchingStrategy { mode: 'immediate', }; } else if (strategyMode === 'deferred') { - // TODO(freben): Make parameters configurable + const pollingInterval = + config.getOptionalNumber('catalog.stitchingStrategy.pollingInterval') ?? + 1; + const stitchTimeout = + config.getOptionalNumber('catalog.stitchingStrategy.stitchTimeout') ?? 60; return { mode: 'deferred', - pollingInterval: { seconds: 1 }, - stitchTimeout: { seconds: 60 }, + pollingInterval: { seconds: pollingInterval }, + stitchTimeout: { seconds: stitchTimeout }, }; }