1
0
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:
chylex 2023-10-27 19:16:06 +02:00
parent f942b9830d
commit c2f47cf736
Signed by: chylex
GPG Key ID: 4DE42C8F19A80548

View File

@ -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;
}
}