Stream management fix

This commit is contained in:
Elizabeth Cray 2024-10-04 19:44:42 -04:00
parent 0da438d46b
commit a59def6a21

View File

@ -31,10 +31,8 @@ export const handler = async (event) => {
console.warn(error);
result = JSON.stringify(error);
}
stream.on('close', (code, signal) => {
// COMPLETE
console.info("Trigger completed", code, signal)
result = code;
stream.on('end', () => {
console.info("Stream ended");
const response = {
statusCode: 200,
body: {
@ -42,6 +40,11 @@ export const handler = async (event) => {
},
};
return response;
});
stream.on('close', (code, signal) => {
// COMPLETE
console.info("Trigger completed", code, signal)
result = code;
}).stderr.on('data', (data) => {
// STDERR
console.warn(data);