[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [sbws/master] Stop using food terms



commit 410d31e5fe1cc654597c99fe39426bac4d3af878
Author: Matt Traudt <sirmatt@xxxxxxx>
Date:   Wed Aug 1 19:39:49 2018 -0400

    Stop using food terms
---
 sbws/config.default.ini |  4 ++--
 sbws/core/cleanup.py    | 24 ++++++++++++++----------
 sbws/util/config.py     |  4 ++--
 3 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/sbws/config.default.ini b/sbws/config.default.ini
index fd6a58c..b8404da 100644
--- a/sbws/config.default.ini
+++ b/sbws/config.default.ini
@@ -63,9 +63,9 @@ extra_lines =
 
 [cleanup]
 # After this many days, compress data files
-stale_days = 10
+data_files_compress_after_days = 10
 # After this many days, delete data files
-rotten_days = 90
+data_files_delete_after_days = 90
 # After this many days, compress v3bw files (1d)
 v3bw_files_compress_after_days = 1
 # After this many days, delete v3bw files (7d)
diff --git a/sbws/core/cleanup.py b/sbws/core/cleanup.py
index 7dc7e78..18d8380 100644
--- a/sbws/core/cleanup.py
+++ b/sbws/core/cleanup.py
@@ -103,19 +103,21 @@ def _check_validity_periods_results(
         data_period, compress_after_days, delete_after_days):
     if compress_after_days - 2 < data_period:
         fail_hard(
-            'For safetly, cleanup/stale_days (%d) must be at least 2 days '
-            'larger than general/data_period (%d)', compress_after_days,
-            data_period)
+            'For safetly, cleanup/data_files_compress_after_days (%d) must be '
+            'at least 2 days larger than general/data_period (%d)',
+            compress_after_days, data_period)
     if delete_after_days < compress_after_days:
         fail_hard(
-            'cleanup/rotten_days (%d) must be the same or larger than '
-            'cleanup/stale_days (%d)', delete_after_days, compress_after_days)
+            'cleanup/data_files_delete_after_days (%d) must be the same or '
+            'larger than cleanup/data_files_compress_after_days (%d)',
+            delete_after_days, compress_after_days)
     if compress_after_days / 2 < data_period:
         log.warning(
-            'cleanup/stale_days (%d) is less than twice '
+            'cleanup/data_files_compress_after_days (%d) is less than twice '
             'general/data_period (%d). For ease of parsing older results '
-            'if necessary, it is recommended to make stale_days at least '
-            'twice the data_period.', compress_after_days, data_period)
+            'if necessary, it is recommended to make '
+            'data_files_compress_after_days at least twice the data_period.',
+            compress_after_days, data_period)
     return True
 
 
@@ -146,8 +148,10 @@ def _clean_result_files(args, conf):
     if not os.path.isdir(datadir):
         fail_hard('%s does not exist', datadir)
     data_period = conf.getint('general', 'data_period')
-    compress_after_days = conf.getint('cleanup', 'stale_days')
-    delete_after_days = conf.getint('cleanup', 'rotten_days')
+    compress_after_days = conf.getint(
+        'cleanup', 'data_files_compress_after_days')
+    delete_after_days = conf.getint(
+        'cleanup', 'data_files_delete_after_days')
     _check_validity_periods_results(
         data_period, compress_after_days, delete_after_days)
 
diff --git a/sbws/util/config.py b/sbws/util/config.py
index 82ce0ec..2898d1b 100644
--- a/sbws/util/config.py
+++ b/sbws/util/config.py
@@ -172,8 +172,8 @@ def _validate_cleanup(conf):
     sec = 'cleanup'
     err_tmpl = Template('$sec/$key ($val): $e')
     ints = {
-        'stale_days': {'minimum': 1, 'maximum': None},
-        'rotten_days': {'minimum': 1, 'maximum': None},
+        'data_files_compress_after_days': {'minimum': 1, 'maximum': None},
+        'data_files_delete_after_days': {'minimum': 1, 'maximum': None},
         'v3bw_files_compress_after_days': {'minimum': 1, 'maximum': None},
         'v3bw_files_delete_after_days': {'minimum': 1, 'maximum': None},
     }



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits