Skip to content

Commit

Permalink
Merge pull request #5 from maxceem/develop
Browse files Browse the repository at this point in the history
fix: error finally() is not a function
  • Loading branch information
vikasrohit committed Oct 31, 2019
2 parents 180919b + 4fb7786 commit 79ae470
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,14 @@ const dataHandler = (messageSet, topic, partition) => Promise.each(messageSet, (
throw new Error(`Invalid topic: ${topic}`)
}
})()
// commit offset regardless of errors
.then(() => {})
.catch((err) => { logger.logFullError(err) })
.finally(() => consumer.commitOffset({ topic, partition, offset: m.offset }))
.then(() => {
consumer.commitOffset({ topic, partition, offset: m.offset })
})
.catch((err) => {
logger.logFullError(err)
// commit offset regardless of errors
consumer.commitOffset({ topic, partition, offset: m.offset })
})
})

/**
Expand Down

0 comments on commit 79ae470

Please sign in to comment.