プロジェクト

全般

プロフィール

Vote #79929

未完了

Issues CSV / PDF export via ActiveJob

Admin Redmine さんが約2年前に追加. 約2年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Issues_2
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
2
version_id:
32
issue_org_id:
31076
author_id:
40856
assigned_to_id:
0
comments:
13
status_id:
1
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

Why?
Exporting large amounts of issues and/or issues with a lot of custom fields as CSV or PDF can take a long time, to the point where users run into HTTP timeouts and cannot successfully do their exports.

How?
This patch which has been extracted from "Planio":https://plan.io/redmine-hosting allows for such exports to be run in a queueing backend like DelayedJob (that's what we use, but any supported ActiveJob backend should be fine). Exports with less than 1000 issues or exports that take less than 30 seconds to finish will be delivered to the user immediately as a download (just as it is without this patch), but after 30 seconds, the controller gives up waiting and returns the user to the previous issues listing. An email with a download link will be sent to the user once the export is finished.

Without a configured ActiveJob backend everything will be as before and all exports are processed in-request. The background export logic itself is generic and we use the same approach for running time entry exports in the background as well. I'll post that as a separate patch if there's interest in integrating this into Redmine at all.

Patches are against current master. Patch no 1 adds a @lazy_issues@ method to @IssueQuery@ which fetches issues in batches (to avoid high memory usage). Patch no 2 implements the background execution.


journals

related to #24477, #24473
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Awesome!
--------------------------------------------------------------------------------
Please let me know the following points:

1. Why do you skip filesize validation?
2. How do I remove attachment file after download finished. Can I remove it on browser?

--------------------------------------------------------------------------------
Good points, thanks for bringing them up.

> 1. Why do you skip filesize validation?

We do this to avoid running into a filesize validation error in the background worker. We want these background exports to succeed even if the file violates size constraints. We feel this is OK since the resulting files are only temporary and will not stay on the system for long time, anyway (see below).

> 2. How do I remove attachment file after download finished. Can I remove it on browser?

The resulting attachments are _orphaned_, without any container object. As such, they are fairly easy to detect and clean up i.e. by a cron job running @rake redmine:attachments:prune@ daily.

--------------------------------------------------------------------------------
I understood above. Thanks your explaination!

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

relates,New,24477,CSV export feature for thousand of issues
relates,New,24473,CSV Export Very slow for issues with lots of Custom Fields
relates,New,36691,Background job and dedicated status for project deletion

Admin Redmine さんが約2年前に更新

  • カテゴリIssues_2 にセット
  • 対象バージョンCandidate for next major release_32 にセット

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

いいね!0
いいね!0