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

[tor-commits] [sbws/master] Check conf options for cleaning v3bw files



commit 1dbcd45262c1cbabcabb14596e8171e1497bf957
Author: juga0 <juga@xxxxxxxxxx>
Date:   Tue Jul 17 17:13:45 2018 +0000

    Check conf options for cleaning v3bw files
---
 sbws/core/cleanup.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sbws/core/cleanup.py b/sbws/core/cleanup.py
index d726a23..2099a62 100644
--- a/sbws/core/cleanup.py
+++ b/sbws/core/cleanup.py
@@ -155,6 +155,13 @@ def _compress_stale_files(datadir, stale_days, dry_run=True):
             os.remove(fname)
 
 
+def _check_validity_periods_v3bw(compress_after_days, delete_after_days):
+    if 1 <= compress_after_days and compress_after_days < delete_after_days:
+        return True
+    fail_hard("v3bw files should only be compressed after 1 day and deleted "
+              "after a bigger number of days.")
+
+
 def main(args, conf):
     '''
     Main entry point in to the cleanup command.



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