mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 11:27:52 +08:00
PERF: Only delete 100 inactive users at once
This commit is contained in:
@ -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|
|
||||
|
Reference in New Issue
Block a user