Skip to content

Commit

Permalink
Fix: Broken line counting
Browse files Browse the repository at this point in the history
Current line should only be increased when we
advance one line in the log, but now it is
increased:

   (every line * total number of indications)
  • Loading branch information
GLundh committed Mar 2, 2022
1 parent f091d23 commit 7758cd4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,10 @@ public static List<FoundFailureCause> scanSingleLinePatterns(List<FailureCause>
timerThread.start();
try {
long startTime = System.currentTimeMillis();
int currentLine = 1;
int currentLine = 0;
String line;
while ((line = reader.readLine()) != null) {
currentLine++;
for (FailureCause cause : causes) {
for (Indication indication : cause.getIndications()) {
try {
Expand All @@ -198,7 +199,6 @@ public static List<FoundFailureCause> scanSingleLinePatterns(List<FailureCause>
throw e;
}
}
currentLine++;
timerThread.touch();
if (System.currentTimeMillis() - startTime > adjustedFileTimeout) {
logger.warning("File timeout scanning for indication '" + indication.toString() + "'"
Expand Down

0 comments on commit 7758cd4

Please sign in to comment.