Skip to content

Commit

Permalink
close connection
Browse files Browse the repository at this point in the history
  • Loading branch information
Joao-vi committed Oct 28, 2024
1 parent e44d40d commit f5d8231
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/api/suggestions/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ async function processTrainFunction(
return;
}

await IX.stop();
const status = await callback(new ObjectId(req.body.extractorId));
res.json(status);
}
Expand Down Expand Up @@ -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();
}
);

Expand All @@ -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();
}
);

Expand Down

0 comments on commit f5d8231

Please sign in to comment.