mirror of
https://github.com/chylex/Apache-Prometheus-Exporter.git
synced 2025-04-28 19:15:43 +02:00
Skip existing lines when a log file is recreated due to spurious file creation events
This commit is contained in:
parent
f942b9830d
commit
c2f47cf736
@ -161,6 +161,11 @@ impl LogWatcher {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
while let Ok(Some(_)) = self.state.lines.next_line().await {
|
||||||
|
// There are occasional spurious file creation events, so reading
|
||||||
|
// from the beginning would read lines that were already counted.
|
||||||
|
}
|
||||||
|
|
||||||
continue 'read_loop;
|
continue 'read_loop;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user