fix: stitching queue gauge to not include entities from the future

Signed-off-by: zcmander <zcmander@gmail.com>
This commit is contained in:
zcmander
2024-04-25 14:11:18 +03:00
parent 122d0d4466
commit 8479a0be3f
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend': patch
---
Fixed bug in stitching queue gauge that included entities that are scheduled in the future.
@@ -54,7 +54,8 @@ export function progressTracker(knex: Knex, logger: LoggerService) {
stitchingQueueCount.addCallback(async result => {
const total = await knex<DbRefreshStateRow>('refresh_state')
.count({ count: '*' })
.whereNotNull('next_stitch_at');
.whereNotNull('next_stitch_at')
.where('next_stitch_at', '<=', knex.fn.now());
result.observe(Number(total[0].count));
});