From eeba72cd4cbf44791b47ef7dfde3d265e252145c Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sat, 24 Oct 2015 23:49:02 +0200 Subject: [PATCH] mod_http_upload_quota: Fix "max_days" expiry run Use the path names of old files to delete them (instead of the tuples returned by the gather_file_info/1 function). --- mod_http_upload/src/mod_http_upload_quota.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod_http_upload/src/mod_http_upload_quota.erl b/mod_http_upload/src/mod_http_upload_quota.erl index 4c47874..3abea3f 100644 --- a/mod_http_upload/src/mod_http_upload_quota.erl +++ b/mod_http_upload/src/mod_http_upload_quota.erl @@ -276,8 +276,8 @@ enforce_quota(UserDir, SlotSize, _OldSize, MinSize, MaxSize) -> -spec delete_old_files(file:filename_all(), integer()) -> ok. delete_old_files(UserDir, Timestamp) -> - case lists:filter(fun({_Path, _Size, Time}) -> Time < Timestamp end, - gather_file_info(UserDir)) of + FileInfo = gather_file_info(UserDir), + case [Path || {Path, _Size, Time} <- FileInfo, Time < Timestamp] of [] -> ok; OldFiles ->