remove singleton pattern from indexer

Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
This commit is contained in:
Anders Näsman
2021-03-17 11:06:26 +01:00
committed by Eric Peterson
parent 51fc8de48c
commit 5a045906c2
4 changed files with 19 additions and 57 deletions
+4 -6
View File
@@ -14,23 +14,21 @@
* limitations under the License.
*/
import { createRouter } from '@backstage/plugin-search-backend';
import {
collateDocuments,
// registerCollator,
} from '@backstage/plugin-search-backend-node';
import { Registry } from '@backstage/plugin-search-backend-node';
import { PluginEnvironment } from '../types';
// import { DefaultCatalogCollator } from '@backstage/plugin-catalog-backend';
export default async function createPlugin({ logger }: PluginEnvironment) {
const indexRegistry = new Registry();
// TODO: Within this PR, update to use REST API instead of Catalog Builder.
/* registerCollator({
/* indexRegistry.addCollator({
type: 'software-catalog',
defaultRefreshIntervalSeconds: 600,
collator: new DefaultCatalogCollator(entitiesCatalog),
});*/
// TODO: Make this a more proper refresh loop.
collateDocuments();
indexRegistry.execute();
return await createRouter({
logger,