Comparison

mod_migrate_http_upload/mod_migrate_http_upload.lua @ 4471:af7a9856950d

mod_migrate_http_upload: Don't include per-upload directory twice
author Kim Alvefur <zash@zash.se>
date Wed, 24 Feb 2021 18:13:19 +0100
parent 4470:203f0f06d766
child 4472:f210f242cf17
comparison
equal deleted inserted replaced
4470:203f0f06d766 4471:af7a9856950d
32 end 32 end
33 end 33 end
34 if not oldest_uploads then break end 34 if not oldest_uploads then break end
35 local item = table.remove(oldest_uploads, 1); 35 local item = table.remove(oldest_uploads, 1);
36 local source_directory = paths.join(legacy_storage_path, item.dir); 36 local source_directory = paths.join(legacy_storage_path, item.dir);
37 local source_filename = paths.join(source_directory, item.dir, item.filename); 37 local source_filename = paths.join(source_directory, item.filename);
38 local target_filename = dm.getpath(item.dir, component, "http_file_share", "bin", true); 38 local target_filename = dm.getpath(item.dir, component, "http_file_share", "bin", true);
39 if not lfs.attributes(source_filename, "mode") then 39 if not lfs.attributes(source_filename, "mode") then
40 print("Not migrating missing file " .. source_filename); 40 print("Not migrating missing file " .. source_filename);
41 else 41 else
42 print("Moving " .. source_filename .. " to " .. target_filename .. " for " .. uploader); 42 print("Moving " .. source_filename .. " to " .. target_filename .. " for " .. uploader);