commit 4879cdc219c797e3e0a54226978462fe67d7cf3b Author: Karsten Loesing karsten.loesing@gmx.net Date: Fri Dec 11 16:55:37 2020 +0100
Fix a few paths for cleaning up. --- .../metrics/collector/bridgedb/BridgedbMetricsProcessor.java | 6 ++++-- .../metrics/collector/bridgedescs/SanitizedBridgesWriter.java | 6 ++++-- .../metrics/collector/snowflake/SnowflakeStatsDownloader.java | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/src/main/java/org/torproject/metrics/collector/bridgedb/BridgedbMetricsProcessor.java b/src/main/java/org/torproject/metrics/collector/bridgedb/BridgedbMetricsProcessor.java index d05aa9c..94f697e 100644 --- a/src/main/java/org/torproject/metrics/collector/bridgedb/BridgedbMetricsProcessor.java +++ b/src/main/java/org/torproject/metrics/collector/bridgedb/BridgedbMetricsProcessor.java @@ -178,9 +178,11 @@ public class BridgedbMetricsProcessor extends CollecTorMain { * in the last three days (seven weeks). */ private void cleanUpDirectories() { - PersistenceUtils.cleanDirectory(Paths.get(this.recentPathName), + PersistenceUtils.cleanDirectory( + Paths.get(this.recentPathName).resolve("bridgedb-metrics"), Instant.now().minus(3, ChronoUnit.DAYS).toEpochMilli()); - PersistenceUtils.cleanDirectory(Paths.get(this.outputPathName), + PersistenceUtils.cleanDirectory( + Paths.get(this.outputPathName).resolve("bridgedb-metrics"), Instant.now().minus(49, ChronoUnit.DAYS).toEpochMilli()); } } diff --git a/src/main/java/org/torproject/metrics/collector/bridgedescs/SanitizedBridgesWriter.java b/src/main/java/org/torproject/metrics/collector/bridgedescs/SanitizedBridgesWriter.java index 7619453..ffafdea 100644 --- a/src/main/java/org/torproject/metrics/collector/bridgedescs/SanitizedBridgesWriter.java +++ b/src/main/java/org/torproject/metrics/collector/bridgedescs/SanitizedBridgesWriter.java @@ -449,9 +449,11 @@ public class SanitizedBridgesWriter extends CollecTorMain { * in the last three days (seven weeks), and remove the .tmp extension from * newly written files. */ private void cleanUpDirectories() { - PersistenceUtils.cleanDirectory(this.recentDirectory, + PersistenceUtils.cleanDirectory( + this.recentDirectory.resolve("bridge-descriptors"), Instant.now().minus(3, ChronoUnit.DAYS).toEpochMilli()); - PersistenceUtils.cleanDirectory(this.outputDirectory, + PersistenceUtils.cleanDirectory( + this.outputDirectory.resolve("bridge-descriptors"), Instant.now().minus(49, ChronoUnit.DAYS).toEpochMilli()); } } diff --git a/src/main/java/org/torproject/metrics/collector/snowflake/SnowflakeStatsDownloader.java b/src/main/java/org/torproject/metrics/collector/snowflake/SnowflakeStatsDownloader.java index 93388d5..c9b6b03 100644 --- a/src/main/java/org/torproject/metrics/collector/snowflake/SnowflakeStatsDownloader.java +++ b/src/main/java/org/torproject/metrics/collector/snowflake/SnowflakeStatsDownloader.java @@ -156,9 +156,11 @@ public class SnowflakeStatsDownloader extends CollecTorMain { /** Delete all files from the rsync (out) directory that have not been * modified in the last three days (seven weeks). */ private void cleanUpDirectories() { - PersistenceUtils.cleanDirectory(Paths.get(this.recentPathName), + PersistenceUtils.cleanDirectory( + Paths.get(this.recentPathName, "snowflakes"), Instant.now().minus(3, ChronoUnit.DAYS).toEpochMilli()); - PersistenceUtils.cleanDirectory(Paths.get(this.outputPathName), + PersistenceUtils.cleanDirectory( + Paths.get(this.outputPathName, "snowflakes"), Instant.now().minus(49, ChronoUnit.DAYS).toEpochMilli()); } }