catalyst / moodle-tool_objectfs

Object file storage system for Moodle
https://moodle.org/plugins/tool_objectfs
88 stars 72 forks source link

Extend file delete of local files to files which might have wrong location metadata #588

Open brendanheywood opened 11 months ago

brendanheywood commented 11 months ago

If you have a file which is marked as remote only, but the file is also still present locally then its metadata is wrong and it won't get picked up for file deletion.

If deletelocal is on then these should be removed, but if it is not then they should remain.

Even if deletelocal is on we should wait until most of the files have been correctly deleted before kicking in a second round of cleanup where we recurse filedir and look for any remaining files. The simplest thing it could do is just ensure that its location includes the bit for being local and then it will get deleted as per normal.

This could be the same task or another task, but it should not run unless deletelocal is on.

We previously tackled essentially this here but it did not land:

https://github.com/catalyst/moodle-tool_objectfs/issues/193

https://github.com/catalyst/moodle-tool_objectfs/pull/211/files