mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 18:58:10 +00:00
PERF: Only delete 100 inactive users at once
This commit is contained in:
parent
5caf72510c
commit
ba15a6a9ea
@ -728,6 +728,7 @@ class User < ActiveRecord::Base
|
||||
.joins('INNER JOIN user_stats AS us ON us.user_id = users.id')
|
||||
.where("created_at < ?", SiteSetting.purge_inactive_users_grace_period_days.days.ago)
|
||||
.where('us.post_count = 0')
|
||||
.limit(100)
|
||||
|
||||
destroyer = UserDestroyer.new(Discourse.system_user)
|
||||
to_destroy.each do |u|
|
||||
|
Loading…
x
Reference in New Issue
Block a user