Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable restarting bulk export #9020

Conversation

arafubeatbox
Copy link
Contributor

@arafubeatbox arafubeatbox commented Aug 7, 2024

restart までの実行内容

  1. PageBulkExportJob の restart をリクエストされた場合は実行中の stream を BulkExportJobRestartedError で destroy する
  2. BulkExportJobRestartedError をキャッチし、実行中の job の内容を cleanup する
  3. 再度 PageBulkExportJob を実行する

task

https://redmine.weseek.co.jp/issues/151978

screenshot

image

Copy link

changeset-bot bot commented Aug 7, 2024

⚠️ No Changeset found

Latest commit: 4394b48

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

<button className="btn btn-primary" type="button" onClick={() => startBulkExport(PageBulkExportFormat.md)}>
{t('page_export.markdown')}
</button>
<button className="btn btn-primary ms-2" type="button" onClick={() => startBulkExport(PageBulkExportFormat.pdf)}>PDF</button>
{/* TODO: enable in https://redmine.weseek.co.jp/issues/135772 */}
{/* <button className="btn btn-primary ms-2" type="button" onClick={() => startBulkExport(PageBulkExportFormat.pdf)}>PDF</button> */}
Copy link
Contributor Author

@arafubeatbox arafubeatbox Aug 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pdf 形式は一旦リリースを見送るため、選択肢をコメントアウト

@arafubeatbox arafubeatbox marked this pull request as ready for review August 7, 2024 14:38
Base automatically changed from feat/147526-151412-reuse-upload-on-duplicate-request to feat/page-bulk-export August 26, 2024 10:54
else if (err instanceof BulkExportJobRestartedError) {
logger.info(err.message);
await this.cleanUpExportJobResources(pageBulkExportJob);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BulkExportJobRestartedError の場合は cleanup をするだけで、通知はしない。

const errorCode = e?.[0].code ?? 'page_export.failed_to_export';
toastError(t(errorCode));
if (errorCode === 'page_export.duplicate_bulk_export_job_error') {
setIsRestartModalOpened(true);
Copy link
Member

@yuki-takei yuki-takei Aug 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

重複している job の情報の一部をエラーに追加し、それをモーダルに追加表示させよう。
そうすることでユーザーが中断すべきかどうかを判断しやすくなると思う。

(以下一例)

  • 作成日時
  • トリガーしたユーザー
  • その他表示した方がいい情報があれば

後続タスクでもよい

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

後続タスクで実装しますm(_ _)m
https://redmine.weseek.co.jp/issues/153064

@arafubeatbox arafubeatbox merged commit 7976928 into feat/page-bulk-export Aug 26, 2024
5 checks passed
@arafubeatbox arafubeatbox deleted the feat/150418-151978-enable-restarting-bulk-export branch August 26, 2024 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants