Skip to content

Commit 57e10ab

Browse files
committed
log
1 parent 0a574d2 commit 57e10ab

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cloudwatch-logs.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ export function main () {
5050

5151
rl.on('close', () => {
5252
console.log('Finished parsing log file.')
53-
processLines().then(() => console.log('Finished processing lines.'))
53+
processLines().then(() => {
54+
console.log('Finished processing lines.')
55+
rabbit.close().catch(() => console.log('rabbit closed'))
56+
})
5457
})
5558

5659
rl.on('error', (e) => {
@@ -61,5 +64,4 @@ export function main () {
6164
// Run main function if this file is executed directly
6265
if (import.meta.url === `file://${process.argv[1]}`) {
6366
main()
64-
setTimeout(rabbit.close, 20000)
6567
}

0 commit comments

Comments
 (0)