mirror of
https://github.com/chylex/Apache-Prometheus-Exporter.git
synced 2025-04-10 02:15:45 +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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user