changeset 2681:8d8ba28d020f

mod_http_upload: Consider files deleted even if remove fails
author Kim Alvefur <zash@zash.se>
date Thu, 13 Apr 2017 20:59:55 +0200
parents 96bf67f1f960
children 3fd50495c89d
files mod_http_upload/mod_http_upload.lua
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mod_http_upload/mod_http_upload.lua	Thu Apr 13 20:23:17 2017 +0200
+++ b/mod_http_upload/mod_http_upload.lua	Thu Apr 13 20:59:55 2017 +0200
@@ -81,11 +81,10 @@
 	uploads:filter(function (item)
 		if item.time < expiry then
 			local deleted, whynot = os.remove(item.filename);
-			if deleted then
-				return false;
-			else
+			if not deleted then
 				module:log("warn", "Could not delete expired upload %s: %s", item.filename, whynot or "delete failed");
 			end
+			return false;
 		end
 		return true;
 	end);