Illustrate potential software catalog indexing.

Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
This commit is contained in:
Eric Peterson
2021-02-15 17:36:45 +01:00
parent 3e2e3ffe4f
commit 3e9d8427b6
8 changed files with 96 additions and 3 deletions
+1
View File
@@ -41,6 +41,7 @@
"@backstage/plugin-rollbar-backend": "^0.1.8",
"@backstage/plugin-scaffolder-backend": "^0.9.2",
"@backstage/plugin-search-backend": "^0.1.1",
"@backstage/plugin-search-indexer-backend": "^0.1.1",
"@backstage/plugin-techdocs-backend": "^0.6.5",
"@backstage/plugin-todo-backend": "^0.1.1",
"@gitbeaker/node": "^28.0.2",
+2
View File
@@ -110,6 +110,8 @@ async function main() {
console.log(err);
process.exit(1);
});
// @todo Start Search Refresh Loop Here?
}
module.hot?.accept();
+8
View File
@@ -19,8 +19,10 @@ import {
CatalogBuilder,
createRouter,
runPeriodically,
SearchCollatorFactory,
} from '@backstage/plugin-catalog-backend';
import { Router } from 'express';
import { registerCollator } from '@backstage/plugin-search-indexer-backend';
import { PluginEnvironment } from '../types';
export default async function createPlugin(
@@ -39,6 +41,12 @@ export default async function createPlugin(
runPeriodically(() => higherOrderOperation.refreshAllLocations(), 100000),
);
registerCollator({
type: 'software-catalog',
defaultRefreshIntervalSeconds: 600,
collator: SearchCollatorFactory(entitiesCatalog),
});
return await createRouter({
entitiesCatalog,
locationsCatalog,