From 2aa408f466af891b12ec301d80ad06ba8253b6cf Mon Sep 17 00:00:00 2001 From: Chris Wyatt Cook Date: Mon, 23 Jun 2025 18:00:40 -0700 Subject: [PATCH] update burstLength type to Duration Signed-off-by: Chris Wyatt Cook --- .../src/engine/IncrementalIngestionEngine.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/plugins/catalog-backend-module-incremental-ingestion/src/engine/IncrementalIngestionEngine.ts b/plugins/catalog-backend-module-incremental-ingestion/src/engine/IncrementalIngestionEngine.ts index aeccaccf8d..4ecff02301 100644 --- a/plugins/catalog-backend-module-incremental-ingestion/src/engine/IncrementalIngestionEngine.ts +++ b/plugins/catalog-backend-module-incremental-ingestion/src/engine/IncrementalIngestionEngine.ts @@ -27,7 +27,7 @@ import { HumanDuration } from '@backstage/types'; export class IncrementalIngestionEngine implements IterationEngine { private readonly restLength: Duration; - private readonly burstLength: HumanDuration; + private readonly burstLength: Duration; private readonly backoff: HumanDuration[]; private readonly lastStarted: Gauge; private readonly lastCompleted: Gauge; @@ -39,7 +39,7 @@ export class IncrementalIngestionEngine implements IterationEngine { this.manager = options.manager; this.restLength = Duration.fromObject(options.restLength); - this.burstLength = options.burstLength; + this.burstLength = Duration.fromObject(options.burstLength); this.backoff = options.backoff ?? [ { minutes: 1 }, { minutes: 5 }, @@ -251,12 +251,10 @@ export class IncrementalIngestionEngine implements IterationEngine { break; } else if ( performance.now() - start > - Duration.fromObject(this.burstLength).as('milliseconds') + this.burstLength.as('milliseconds') ) { this.options.logger.info( - `incremental-engine: Ingestion '${id}' burst exceeded length of ${Duration.fromObject( - this.burstLength, - ).toHuman()}.`, + `incremental-engine: Ingestion '${id}' burst exceeded length of ${this.burstLength.toHuman()}.`, ); break; } else {