FIX: Don't error CleanUpInactiveUserJob when user is missing (#8362)

This commit is contained in:
Krzysztof Kotlarek 2019-11-18 16:14:15 +11:00 committed by GitHub
parent 7d389df5e7
commit 975165f25f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,7 +30,8 @@ module Jobs
User.transaction do User.transaction do
ids.each do |id| ids.each do |id|
begin begin
user = User.find(id) user = User.find_by(id: id)
next unless user
destroyer.destroy(user, transaction: false, context: I18n.t("user.destroy_reasons.inactive_user")) destroyer.destroy(user, transaction: false, context: I18n.t("user.destroy_reasons.inactive_user"))
rescue => e rescue => e
Discourse.handle_job_exception(e, Discourse.handle_job_exception(e,