Jparcill/5547 Stream Distributions CSV instead of pregenerating#5523
Open
jparcill wants to merge 4 commits intorubyforgood:mainfrom
Open
Jparcill/5547 Stream Distributions CSV instead of pregenerating#5523jparcill wants to merge 4 commits intorubyforgood:mainfrom
jparcill wants to merge 4 commits intorubyforgood:mainfrom
Conversation
jparcill
commented
Mar 27, 2026
| include ItemsHelper | ||
|
|
||
| def initialize(distributions:, organization:, filters: []) | ||
| # Currently, the @distributions are already loaded by the controllers that are delegating exporting |
Contributor
Author
There was a problem hiding this comment.
I'm not sure this is actually accurate. I originally used find_each when trying to export on my localenvironment and the code worked.
indicating that the distributions were not in memory yet
I've since switched to using each instead just so that the spec file runs since the tests expect an array
This file contains hidden or 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
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.
Resolves #5477
Description
Stream the exporting of the Distributions CSV instead of generating the CSV before download. This allows download to start immediately and at this point the download can occur as long as the client wants.
Type of change
How Has This Been Tested?
Another test that I did was to simulate a large download with the following code on my local env.
This downloaded a 3.5 MB file over >30 seconds.