Skip to content

Commit 3987647

Browse files
exit from consumer batch loop when no more messages left (#153)
1 parent aec326e commit 3987647

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Sources/Kafka/KafkaConsumer.swift

+3-2
Original file line numberDiff line numberDiff line change
@@ -467,9 +467,10 @@ public final class KafkaConsumer: Sendable, Service {
467467
result = .failure(error)
468468
}
469469

470-
if let result {
471-
messageResults.append(result)
470+
guard let result else {
471+
return messageResults
472472
}
473+
messageResults.append(result)
473474
}
474475

475476
return messageResults

0 commit comments

Comments
 (0)