Skip to content

Commit c9739a0

Browse files
Federico CerattoFederico Ceratto
Federico Ceratto
authored and
Federico Ceratto
committed
Fastpath 0.28 file trimming safety
1 parent 8893182 commit c9739a0

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

af/fastpath/debian/changelog

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
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+
17
fastpath (0.27) unstable; urgency=medium
28

39
* Stream cans

af/fastpath/fastpath/core.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1217,12 +1217,11 @@ def _trim_old_measurements(conf):
12171217
# The globbing gets slower with larger backlogs but the quadratic behavior
12181218
# can become as aggressive as needed
12191219
keep_hours = free_gb ** 2
1220+
keep_hours = max(keep_hours, 24) # safety
12201221
log.info(
12211222
"Starting file trimming: %.1f GB free, keeping the last %.2f hours"
12221223
% (free_gb, keep_hours)
12231224
)
1224-
1225-
assert keep_hours > 24 # temporary
12261225
# Delete files ignoring race conditions
12271226
time_threshold = time.time() - 3600 * keep_hours
12281227
file_cnt = 0

0 commit comments

Comments
 (0)