psu-libraries / researcher-metadata

Penn State University's faculty and research metadata repository
https://metadata.libraries.psu.edu/
MIT License
7 stars 0 forks source link

Carrierwave leaves behind empty directories #824

Closed whereismyjetpack closed 1 month ago

whereismyjetpack commented 1 year ago

When performing a restore this morning, I noticed a bunch of empty directories in the uploads directory. This is due to carrierwave not removing the directory of a file when the file is removed. This seems to be a long standing issue, that can be resolved with an after_action. I like the solution proposed here

https://github.com/carrierwaveuploader/carrierwave/issues/222

If we think this is sane work to do, I can get started on it

EricDurante commented 1 year ago

This seems to be a long standing issue, that can be resolved with an after_action

Yeah, this looks like the sanctioned way to do it.

I'd say go ahead 👍

ajkiessl commented 1 year ago

This is fixed for Activity Insight OA Files: https://github.com/psu-libraries/researcher-metadata/blob/main/app/uploaders/activity_insight_file_uploader.rb#L5

It still needs to be done for ScholarSphere files (from the standard OA workflow): https://github.com/psu-libraries/researcher-metadata/blob/main/app/uploaders/scholarsphere_file_uploader.rb#L4