-
Notifications
You must be signed in to change notification settings - Fork 655
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
商品CSVの分割アップロード #4805
Merged
Merged
商品CSVの分割アップロード #4805
+554
−36
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chihiro-adachi
force-pushed
the
improve/csv-split
branch
from
December 15, 2020 22:50
3fd7c5c
to
41d41f0
Compare
kiy0taka
reviewed
Dec 16, 2020
@@ -107,6 +111,12 @@ class CsvImportController extends AbstractCsvImportController | |||
|
|||
private $errors = []; | |||
|
|||
protected $isXmlHttpRequest = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XMLHttpRequestかどうかのフラグではなく、分割アップロードかどうかのフラグだと思うので isSplitCsv
に変更をお願いします。
kiy0taka
suggested changes
Dec 16, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
途中でエラーになった場合に分割したファイルがサーバーに残り続けてしまいます。
@kiy0taka |
kiy0taka
approved these changes
Dec 16, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
概要(Overview・Refs Issue)
商品CSV登録にて、CSVを分割して処理するように対応。
方針(Policy)
背景として、CSVの行数が多い場合に、時間がかかり登録が完了しない・メモリを使い切りシステムエラーが発生するなど、ユーザビリティに難がありました。今回のPRでは、以下のようにファイルを分割して登録するように処理方式を変更しています。
従来との仕様変更点として、1件でもエラーがあればすべてロールバックされていたのが、分割したファイルごとにトランザクションがかかる形になります。
実装に関する補足(Appendix)
互換性保持のため、CSVの登録ロジック自体に変更はありません。
レスポンス返す部分のみ、ajaxでのリクエストの場合にはjsonで返すようにする修正を入れています。・
テスト(Test)
相談(Discussion)
画面UIは以下のように作っています。
マイナーバージョン互換性保持のための制限事項チェックリスト
レビュワー確認項目