Refactor buildTrigger event handling to handle end-of-stream event properly

This commit refactors buildTrigger event handling to ensure that end-of-stream events are handled by closing the connection without logging them.
This commit is contained in:
Cristhian Zanforlin Lousa 2023-06-21 14:05:22 -03:00
commit 0caab2e9ea

View file

@ -83,7 +83,7 @@ export default function BuildTrigger({
// if the event is the end of the stream, close the connection
if (parsedData.end_of_stream) {
eventSource.close();
return;
} else if (parsedData.log) {
// If the event is a log, log it