File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change
1
+ fastpath (0.28) unstable; urgency=medium
2
+
3
+ * Add file trimming safety
4
+
5
+ -- Federico Ceratto <
[email protected] > Tue, 05 May 2020 18:10:21 +0100
6
+
1
7
fastpath (0.27) unstable; urgency=medium
2
8
3
9
* Stream cans
Original file line number Diff line number Diff line change @@ -1217,12 +1217,11 @@ def _trim_old_measurements(conf):
1217
1217
# The globbing gets slower with larger backlogs but the quadratic behavior
1218
1218
# can become as aggressive as needed
1219
1219
keep_hours = free_gb ** 2
1220
+ keep_hours = max (keep_hours , 24 ) # safety
1220
1221
log .info (
1221
1222
"Starting file trimming: %.1f GB free, keeping the last %.2f hours"
1222
1223
% (free_gb , keep_hours )
1223
1224
)
1224
-
1225
- assert keep_hours > 24 # temporary
1226
1225
# Delete files ignoring race conditions
1227
1226
time_threshold = time .time () - 3600 * keep_hours
1228
1227
file_cnt = 0
You can’t perform that action at this time.
0 commit comments