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:
@@ -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();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user