correctly measure stitching queue length

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2024-11-23 17:05:35 +01:00
parent d3bfac4de8
commit 71152e351c
2 changed files with 6 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend': patch
---
Correctly report stitching queue length
@@ -54,8 +54,7 @@ export function progressTracker(knex: Knex, logger: LoggerService) {
stitchingQueueCount.addCallback(async result => {
const total = await knex<DbRefreshStateRow>('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));
});