mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 02:13:38 +08:00
FIX: Don't stop the badge grant after the first failure
This commit is contained in:
parent
260b94e7e1
commit
6ce26ab4d8
|
@ -11,7 +11,12 @@ module Jobs
|
||||||
return unless SiteSetting.enable_badges
|
return unless SiteSetting.enable_badges
|
||||||
|
|
||||||
Badge.all.each do |b|
|
Badge.all.each do |b|
|
||||||
BadgeGranter.backfill(b)
|
begin
|
||||||
|
BadgeGranter.backfill(b)
|
||||||
|
rescue => ex
|
||||||
|
# TODO - expose errors in UI
|
||||||
|
Discourse.handle_job_exception(ex, error_context({}, code_desc: 'Exception granting badges', extra: {badge_id: b.id}))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
BadgeGranter.revoke_ungranted_titles!
|
BadgeGranter.revoke_ungranted_titles!
|
||||||
|
|
|
@ -120,7 +120,9 @@ class BadgeGranter
|
||||||
user_ids = list.map{|i| i["user_ids"]}.flatten.compact.uniq
|
user_ids = list.map{|i| i["user_ids"]}.flatten.compact.uniq
|
||||||
|
|
||||||
next unless post_ids.present? || user_ids.present?
|
next unless post_ids.present? || user_ids.present?
|
||||||
find_by_type(type).each{|badge| backfill(badge, post_ids: post_ids, user_ids: user_ids)}
|
find_by_type(type).each{ |badge|
|
||||||
|
backfill(badge, post_ids: post_ids, user_ids: user_ids)
|
||||||
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user