Skip to content

Commit

Permalink
create-app: Enable new catalog processing engine
Browse files Browse the repository at this point in the history
Signed-off-by: Johan Haals <johan.haals@gmail.com>
  • Loading branch information
jhaals committed Jun 15, 2021
1 parent f686324 commit 9c3840b
Showing 1 changed file with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -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,
Expand Down

0 comments on commit 9c3840b

Please sign in to comment.