Stream management fix
This commit is contained in:
parent
0da438d46b
commit
a59def6a21
11
index.mjs
11
index.mjs
@ -31,10 +31,8 @@ export const handler = async (event) => {
|
|||||||
console.warn(error);
|
console.warn(error);
|
||||||
result = JSON.stringify(error);
|
result = JSON.stringify(error);
|
||||||
}
|
}
|
||||||
stream.on('close', (code, signal) => {
|
stream.on('end', () => {
|
||||||
// COMPLETE
|
console.info("Stream ended");
|
||||||
console.info("Trigger completed", code, signal)
|
|
||||||
result = code;
|
|
||||||
const response = {
|
const response = {
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
body: {
|
body: {
|
||||||
@ -42,6 +40,11 @@ export const handler = async (event) => {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
return response;
|
return response;
|
||||||
|
});
|
||||||
|
stream.on('close', (code, signal) => {
|
||||||
|
// COMPLETE
|
||||||
|
console.info("Trigger completed", code, signal)
|
||||||
|
result = code;
|
||||||
}).stderr.on('data', (data) => {
|
}).stderr.on('data', (data) => {
|
||||||
// STDERR
|
// STDERR
|
||||||
console.warn(data);
|
console.warn(data);
|
||||||
|
Loading…
Reference in New Issue
Block a user