From 71152e351c4b208d010fdef9befd426e8cb1fb4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Sat, 23 Nov 2024 17:05:35 +0100 Subject: [PATCH] correctly measure stitching queue length MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/odd-worms-peel.md | 5 +++++ plugins/catalog-backend/src/stitching/progressTracker.ts | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .changeset/odd-worms-peel.md diff --git a/.changeset/odd-worms-peel.md b/.changeset/odd-worms-peel.md new file mode 100644 index 0000000000..90e05f1e51 --- /dev/null +++ b/.changeset/odd-worms-peel.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend': patch +--- + +Correctly report stitching queue length diff --git a/plugins/catalog-backend/src/stitching/progressTracker.ts b/plugins/catalog-backend/src/stitching/progressTracker.ts index 8c305b4978..9e00a1a01b 100644 --- a/plugins/catalog-backend/src/stitching/progressTracker.ts +++ b/plugins/catalog-backend/src/stitching/progressTracker.ts @@ -54,8 +54,7 @@ export function progressTracker(knex: Knex, logger: LoggerService) { stitchingQueueCount.addCallback(async result => { const total = await knex('refresh_state') .count({ count: '*' }) - .whereNotNull('next_stitch_at') - .where('next_stitch_at', '<=', knex.fn.now()); + .whereNotNull('next_stitch_at'); result.observe(Number(total[0].count)); });