プロジェクト

全般

プロフィール

Vote #76870

完了

Removing attachment after rollback transaction

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Attachments_19
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
19
version_id:
110
issue_org_id:
21125
author_id:
128697
assigned_to_id:
1
comments:
2
status_id:
5
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

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:":https://github.com/Loriowar/redmine_conceptual_attachments/blob/master/lib/redmine_conceptual_attachments/attachment_patch.rb#L10

after_rollback :delete_from_disk, on: :create

Hope, this can be useful for Redmine.


journals

--------------------------------------------------------------------------------
Committed with tests in r15085, thanks.
--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリAttachments_19 にセット
  • 対象バージョン3.3.0_110 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0