Skip to content

Commit

Permalink
exit from consumer batch loop when no more messages left (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
blindspotbounty authored Dec 1, 2023
1 parent aec326e commit 3987647
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Sources/Kafka/KafkaConsumer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,10 @@ public final class KafkaConsumer: Sendable, Service {
result = .failure(error)
}

if let result {
messageResults.append(result)
guard let result else {
return messageResults
}
messageResults.append(result)
}

return messageResults
Expand Down

0 comments on commit 3987647

Please sign in to comment.