Feature #21125

Removing attachment after rollback transaction

Added by Ivan Zabrovskiy about 2 years ago. Updated almost 2 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Attachments
Target version:3.3.0
Resolution:Fixed

Description

I want to extend my previous issue #20388 about transaction in Attachment. There is second case, then we can have a problem. We can save file on disk, but rollback a transaction with creation of Attachment record. In this case we obtain ghost files without link with Attachment. In long term it leads to pollution of file storage.
I fix this situation on one of my plugin by follows way:

after_rollback :delete_from_disk, on: :create

Hope, this can be useful for Redmine.

Associated revisions

Revision 15085
Added by Jean-Philippe Lang almost 2 years ago

Removes attachment from disk after rollback on create (#21125).

History

#1 Updated by Toshi MARUYAMA almost 2 years ago

  • Target version set to 3.3.0

#2 Updated by Jean-Philippe Lang almost 2 years ago

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Committed with tests in r15085, thanks.

Also available in: Atom PDF