Skip to content

Commit

Permalink
Refactor response handling in OTelIngest API to ensure early success …
Browse files Browse the repository at this point in the history
…response is sent consistently
  • Loading branch information
simlarsen committed Dec 9, 2024
1 parent 16f0fe1 commit 7da47d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions OpenTelemetryIngest/API/OTelIngest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,6 @@ router.post(
);
}

Response.sendEmptySuccessResponse(req, res); // send empty response to client early to avoid timeouts.

req.body = req.body.toJSON ? req.body.toJSON() : req.body;

const resourceLogs: JSONArray = req.body["resourceLogs"] as JSONArray;
Expand Down Expand Up @@ -908,6 +906,8 @@ router.post(
// }).catch((err: Error) => {
// logger.error(err);
// });

return Response.sendEmptySuccessResponse(req, res);
} catch (err) {
return next(err);
}
Expand Down

0 comments on commit 7da47d6

Please sign in to comment.