Skip to content

Commit b39a6af

Browse files
committed
Attempt to appease the linter.
1 parent c67e4d7 commit b39a6af

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

reader.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -173,18 +173,18 @@ func (r *Reader) commitOffsetsWithRetry(gen *Generation, offsetStash offsetStash
173173
}
174174
}
175175

176-
if err = gen.CommitOffsetsForGenID(generationID, messages); err == nil {
176+
if commitErr := gen.CommitOffsetsForGenID(generationID, messages); commitErr == nil {
177177
continue
178-
}
179-
// IllegalGeneration error is not retriable, but we should attempt to
180-
// perform the remaining commits
181-
if err == IllegalGeneration {
182-
r.withErrorLogger(func(l Logger) { l.Printf("%v", err) })
183-
illegalGenerationErr = err
184-
// we prevent useless retries and we will attempt to
185-
// commit the remaining generations.
186-
err = nil
187-
offsetStash.removeGenerationID(generationID)
178+
} else {
179+
// IllegalGeneration error is not retriable, but we should attempt to
180+
// perform the remaining commits
181+
if commitErr == IllegalGeneration {
182+
r.withErrorLogger(func(l Logger) { l.Printf("%v", commitErr) })
183+
illegalGenerationErr = commitErr
184+
offsetStash.removeGenerationID(generationID)
185+
} else {
186+
err = commitErr
187+
}
188188
}
189189
}
190190
}

0 commit comments

Comments
 (0)