diff options
| author | Karsten Loesing <karsten.loesing@gmx.net> | 2020-01-09 12:46:09 +0100 |
|---|---|---|
| committer | Karsten Loesing <karsten.loesing@gmx.net> | 2020-01-09 12:46:09 +0100 |
| commit | 76db49572f55b4058f9d8c29f983a007f159dd4e (patch) | |
| tree | 9324485b3ab4fa58bafb78c4651e68d776472b40 | |
| parent | 94b87099197890c1614b301a3c493f47c8003f02 (diff) | |
squash! Avoid reprocessing webstats files.task-32747
- Use the default options CREATE, TRUNCATE_EXISTING, and WRITE for
overwriting the state file rather than just CREATE. The effect was
that we kept lines from before, which is not a big issue, but also
not what we wanted.
| -rw-r--r-- | src/main/java/org/torproject/metrics/collector/webstats/SanitizeWeblogs.java | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/main/java/org/torproject/metrics/collector/webstats/SanitizeWeblogs.java b/src/main/java/org/torproject/metrics/collector/webstats/SanitizeWeblogs.java index e65f834..b3fee06 100644 --- a/src/main/java/org/torproject/metrics/collector/webstats/SanitizeWeblogs.java +++ b/src/main/java/org/torproject/metrics/collector/webstats/SanitizeWeblogs.java @@ -31,7 +31,6 @@ import java.io.OutputStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.nio.file.StandardOpenOption; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.ArrayList; @@ -384,7 +383,7 @@ public class SanitizeWeblogs extends CollecTorMain { lines.add(String.format("%s,%s", logLineDate, e.getKey().path)); } } - Files.write(this.processedWebstatsFile, lines, StandardOpenOption.CREATE); + Files.write(this.processedWebstatsFile, lines); } catch (IOException e) { log.error("Cannot write state file {}.", this.processedWebstatsFile, e); } |
