comparison mod_http_upload/mod_http_upload.lua @ 3590:d8cc8b71a199

mod_http_upload: Propagate errors from expiry procedure
author Kim Alvefur <zash@zash.se>
date Wed, 08 May 2019 13:51:49 +0200
parents dec5683f91a2
children a578b4977bb0
comparison
equal deleted inserted replaced
3589:dec5683f91a2 3590:d8cc8b71a199
78 lfs.mkdir(storage_path); 78 lfs.mkdir(storage_path);
79 79
80 local function expire(username, host) 80 local function expire(username, host)
81 if not max_age then return true; end 81 if not max_age then return true; end
82 local uploads, err = datamanager.list_load(username, host, module.name); 82 local uploads, err = datamanager.list_load(username, host, module.name);
83 if err then return false, err; end
83 if not uploads then return true; end 84 if not uploads then return true; end
84 uploads = array(uploads); 85 uploads = array(uploads);
85 local expiry = os.time() - max_age; 86 local expiry = os.time() - max_age;
86 local upload_window = os.time() - 900; 87 local upload_window = os.time() - 900;
87 uploads:filter(function (item) 88 uploads:filter(function (item)