diff --git a/app/api/suggestions/routes.ts b/app/api/suggestions/routes.ts index 33c6ed595f..e6ec4b3926 100644 --- a/app/api/suggestions/routes.ts +++ b/app/api/suggestions/routes.ts @@ -30,6 +30,7 @@ async function processTrainFunction( return; } + await IX.stop(); const status = await callback(new ObjectId(req.body.extractorId)); res.json(status); } @@ -147,6 +148,7 @@ export const suggestionsRoutes = (app: Application) => { async (req, res, _next) => { const IX = new InformationExtraction(); await processTrainFunction(IX.trainModel, req, res); + await IX.stop(); } ); @@ -158,6 +160,7 @@ export const suggestionsRoutes = (app: Application) => { async (req, res, _next) => { const IX = new InformationExtraction(); await processTrainFunction(IX.status, req, res); + await IX.stop(); } );