Skip to content

Commit

Permalink
fix SeekOffsets data structure
Browse files Browse the repository at this point in the history
  • Loading branch information
bgeisberger committed May 30, 2022
1 parent 4ac6773 commit 80e50fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/consumer/seekOffsets.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = class SeekOffsets extends Map {
getKey(topic, partition) {
return JSON.stringify(topic, partition)
return JSON.stringify([topic, partition])
}

set(topic, partition, offset) {
Expand All @@ -14,7 +14,7 @@ module.exports = class SeekOffsets extends Map {
}

pop(topic, partition) {
if (this.size === 0) {
if (this.size === 0 || !this.has(topic, partition)) {
return
}

Expand Down

0 comments on commit 80e50fb

Please sign in to comment.