mirror of
https://github.com/discourse/discourse.git
synced 2025-02-11 22:04:58 +00:00
67b23c0e22
7a284164 previously switched the UserDestroyer to use find_each when iterating over UserHistory records. Unfortunately, since this logic is wrapped in a transaction, this didn't actually solve the memory usage problem. ActiveRecord maintains references to all modified models within a transaction. This commit updates the logic to use a single SQL query, rather than updating models one-by-one