remove singleton pattern from indexer
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
This commit is contained in:
committed by
Eric Peterson
parent
51fc8de48c
commit
5a045906c2
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user