Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Delay deletion files on s3 #1717

Closed
albertopriore opened this issue Dec 10, 2014 · 5 comments
Closed

Delay deletion files on s3 #1717

albertopriore opened this issue Dec 10, 2014 · 5 comments

Comments

@albertopriore
Copy link

I'm trying to find a way to delay also the deletion of s3 files.
Do anyone have a solution for that?

Thanks in advance!
Alberto

@arcreative
Copy link

👍, I have a model that has_many :attachments, dependent: :destroy, and it takes FOREVER if there are more than a couple of attachments.

@dmitry
Copy link
Contributor

dmitry commented Apr 22, 2015

We are just enabled preserve_files option (https://github.com/thoughtbot/paperclip#file-preservation-for-soft-delete). We don't have much deletions...

@albertopriore
Copy link
Author

Ok @dmitry, but later how can I delete the preserved files definitely?

@dmitry
Copy link
Contributor

dmitry commented Apr 23, 2015

I guess there are no easy ways to do that. I would do that with paranoia gem (https://github.com/radar/paranoia) and https://github.com/thoughtbot/paperclip/blob/master/lib/paperclip/attachment.rb#L557 embedded in a model callback before real deletion, that can happen in a recurring job (every month or week). Currently we are just storing files and database links (through paranoia like gem). Once we want to destroy all them, we just will need to write some small little modified code taken from attachment.rb (code above).

@tute
Copy link
Contributor

tute commented May 9, 2016

This issue describes a very specific use case. I suggest that you ask about it in https://stackoverflow.com/questions/tagged/paperclip, which will get attention
from more people than in this issue tracker.

Closing for now, and happy to continue discussion or reopen if we find improvements to make in paperclip itself.

Thank you for your input! ❤️

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants