Closed max-moser closed 1 year ago
updated the PR, tested it out in a local my-site
and everything works
the changes necessary to make the tests run are contained in https://github.com/inveniosoftware/invenio-files-rest/pull/282
It seems that a deprecation was turned into a removal in sphinx 6. The deprecation warning from sphinx 5:
/home/mmoser/.local/share/virtualenvs/invenio-files-rest-bsTvguby/lib/python3.10/site-packages/sphinx/domains/python.py:512: RemovedInSphinx60Warning: Python directive method get_signature_prefix() returning a string is deprecated. It must now return a list of nodes. Return value was '(task)'.
This PR adds a background task that deletes orphaned files from DB and disk (i.e.
FileInstance
s that don't have anyObjectVersion
s linked with them anymore). It is a slightly adapted version of our custom CLI command: https://gitlab.tuwien.ac.at/fairdata/invenio-utilities-tuw/-/blob/master/invenio_utilities_tuw/cli/files.py#L240Note: The CLI command has been working well enough to clean up unreferenced files of deleted drafts, but I found that the
force
flag has to be provided because the storage is marked as notwritable
.I'll still add tests for the new task, and then mark this as ready for review.