Skip to content

Commit

Permalink
KafkaConsumer: store offsets when .finishing
Browse files Browse the repository at this point in the history
Motivation:

This PR addresses issue #119.

The `KafkaConsumer` should not `fatalError` when storing offsets in
state `.finishing`.

See #119 (comment) for more information why.
  • Loading branch information
felixschlegel committed Aug 23, 2023
1 parent 20c7f54 commit 13eb697
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/Kafka/KafkaConsumer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,9 @@ extension KafkaConsumer {
fatalError("Cannot store offset when consumption has been stopped")
case .consuming(let client, _):
return .storeOffset(client: client)
case .finishing, .finished:
case .finishing(let client):
return .storeOffset(client: client)
case .finished:
fatalError("\(#function) invoked while still in state \(self.state)")
}
}
Expand Down

0 comments on commit 13eb697

Please sign in to comment.