Carrierwave deletes files after the destruction of the object has been completed:
after_commit :remove_avatar! :on => :destroy
https://github.com/carrierwaveuploader/carrierwave
I have a worker that deletes the files. If one of the workers timeout when deleting a file from S3 I lose track of the files on S3 and my bucket becomes a mess (since my object that had the mounted file is gone from my DB).
How should I handle this?
Directly call remove_avatar!
before my object.destroy
and then skip_callback?
Is it safe?