Skip to content

Commit 6b881e5

Browse files
committed
Fixed bug in ReadLogs due to ReadLogs.config.tail defaulting to -1, not 0
1 parent 084ca20 commit 6b881e5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

driver.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,9 @@ func readLogsFromKafka(consumer sarama.Consumer, logTopic string, info logger.In
217217
for _,partition := range partitions {
218218
logrus.WithField("topic", logTopic).Debug("Reading partition: " + strconv.Itoa(int(partition)))
219219

220-
221220
//Default offset to oldest
222221
offset := sarama.OffsetOldest
223-
if config.Tail != 0 {
222+
if config.Tail != -1 && config.Tail != 0{
224223
hwm := highWaterMarks[logTopic][partition]
225224
offset = hwm - int64(config.Tail)
226225
// The offset cannot be less than 0, unless it's a magic number

0 commit comments

Comments
 (0)