[tor-commits] [sbws/master] Check conf options for cleaning v3bw files
pastly at torproject.org
pastly at torproject.org
Thu Aug 9 14:21:19 UTC 2018
commit 1dbcd45262c1cbabcabb14596e8171e1497bf957
Author: juga0 <juga at riseup.net>
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.
More information about the tor-commits
mailing list