mirror of
https://github.com/discourse/discourse.git
synced 2025-02-05 19:11:13 +00:00
This commit makes sure we don't load all data into memory when doing CSV exports. The most important change here made to the recently introduced export of chat messages (3ea31f4). We were loading all data into memory in the first version, with this commit it's not the case anymore. Speaking of old exports. Some of them already use find_each, and it worked as expected, without loading all data into memory. And it will proceed working as expected after this commit. In general, I made sure this change didn't break other CSV exports, first manually, and then by writing system specs for them. Sadly, I haven't managed yet to make those specs stable, they work fine locally, but flaky in GitHub actions, so I've disabled them for now. I'll be making more changes to the CSV exports code soon, those system specs will be very helpful. I'll be running them locally, and I hope I'll manage to make them stable while doing that work.