feat: add missing lifecycle monitoring for catalog, search and server
Signed-off-by: Heikki Hellgren <heikki.hellgren@op.fi>
This commit is contained in:
@@ -98,6 +98,7 @@ export default createBackendPlugin({
|
||||
auth: coreServices.auth,
|
||||
http: coreServices.httpRouter,
|
||||
httpAuth: coreServices.httpAuth,
|
||||
lifecycle: coreServices.rootLifecycle,
|
||||
searchIndexService: searchIndexServiceRef,
|
||||
},
|
||||
async init({
|
||||
@@ -108,6 +109,7 @@ export default createBackendPlugin({
|
||||
auth,
|
||||
http,
|
||||
httpAuth,
|
||||
lifecycle,
|
||||
searchIndexService,
|
||||
}) {
|
||||
let searchEngine = searchEngineRegistry.getSearchEngine();
|
||||
@@ -120,10 +122,16 @@ export default createBackendPlugin({
|
||||
const collators = searchIndexRegistry.getCollators();
|
||||
const decorators = searchIndexRegistry.getDecorators();
|
||||
|
||||
await searchIndexService.start({
|
||||
searchEngine,
|
||||
collators,
|
||||
decorators,
|
||||
lifecycle.addStartupHook(async () => {
|
||||
await searchIndexService.start({
|
||||
searchEngine: searchEngine!,
|
||||
collators,
|
||||
decorators,
|
||||
});
|
||||
});
|
||||
|
||||
lifecycle.addShutdownHook(async () => {
|
||||
await searchIndexService.stop();
|
||||
});
|
||||
|
||||
const router = await createRouter({
|
||||
|
||||
Reference in New Issue
Block a user