Skip to content

Commit 13eb697

Browse files
committed
KafkaConsumer: store offsets when .finishing
Motivation: This PR addresses issue #119. The `KafkaConsumer` should not `fatalError` when storing offsets in state `.finishing`. See #119 (comment) for more information why.
1 parent 20c7f54 commit 13eb697

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/Kafka/KafkaConsumer.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,9 @@ extension KafkaConsumer {
585585
fatalError("Cannot store offset when consumption has been stopped")
586586
case .consuming(let client, _):
587587
return .storeOffset(client: client)
588-
case .finishing, .finished:
588+
case .finishing(let client):
589+
return .storeOffset(client: client)
590+
case .finished:
589591
fatalError("\(#function) invoked while still in state \(self.state)")
590592
}
591593
}

0 commit comments

Comments
 (0)