create-app: Enable new catalog processing engine
Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
@@ -1,30 +1,26 @@
|
||||
import { useHotCleanup } from '@backstage/backend-common';
|
||||
import {
|
||||
CatalogBuilder,
|
||||
createRouter,
|
||||
runPeriodically
|
||||
createRouter
|
||||
} from '@backstage/plugin-catalog-backend';
|
||||
import { Router } from 'express';
|
||||
import { PluginEnvironment } from '../types';
|
||||
|
||||
export default async function createPlugin(env: PluginEnvironment): Promise<Router> {
|
||||
const builder = new CatalogBuilder(env);
|
||||
const builder = await CatalogBuilder.create(env);
|
||||
const {
|
||||
entitiesCatalog,
|
||||
locationsCatalog,
|
||||
higherOrderOperation,
|
||||
locationService,
|
||||
processingEngine,
|
||||
locationAnalyzer,
|
||||
} = await builder.build();
|
||||
|
||||
useHotCleanup(
|
||||
module,
|
||||
runPeriodically(() => higherOrderOperation.refreshAllLocations(), 100000),
|
||||
);
|
||||
await processingEngine.start();
|
||||
|
||||
return await createRouter({
|
||||
entitiesCatalog,
|
||||
locationsCatalog,
|
||||
higherOrderOperation,
|
||||
locationService,
|
||||
locationAnalyzer,
|
||||
logger: env.logger,
|
||||
config: env.config,
|
||||
|
||||
Reference in New Issue
Block a user