Only run provider orphan cleanup if the engine is started in the first place

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2025-08-28 11:23:30 +02:00
parent bc7d142350
commit a4c82adcea
2 changed files with 15 additions and 7 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend': patch
---
Only run provider orphan cleanup if the engine is started in the first place
@@ -622,18 +622,21 @@ export class CatalogBuilder {
enableRelationsCompatibility,
});
if (config.getOptionalString('catalog.orphanProviderStrategy') !== 'keep') {
await evictEntitiesFromOrphanedProviders({
db: providerDatabase,
providers: entityProviders,
logger,
});
}
await connectEntityProviders(providerDatabase, entityProviders);
return {
processingEngine: {
async start() {
if (
config.getOptionalString('catalog.orphanProviderStrategy') !==
'keep'
) {
await evictEntitiesFromOrphanedProviders({
db: providerDatabase,
providers: entityProviders,
logger,
});
}
await processingEngine.start();
await stitcher.start();
},