Commit ab432d73b5dad008b1fd152b629000ea51a0f137
1 parent
9b8e7db5
Exists in
master
and in
27 other branches
profile_suggestions: logging person_id with errors
(ActionItem3234)
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
lib/profile_suggestions_job.rb
| ... | ... | @@ -9,16 +9,16 @@ class ProfileSuggestionsJob < Struct.new(:person_id) |
| 9 | 9 | end |
| 10 | 10 | |
| 11 | 11 | def perform |
| 12 | + logger = Delayed::Worker.logger | |
| 12 | 13 | begin |
| 13 | 14 | person = Person.find(person_id) |
| 14 | 15 | |
| 15 | 16 | ProfileSuggestion::RULES.each do |rule| |
| 16 | 17 | ProfileSuggestion.send(rule, person) |
| 17 | 18 | end |
| 18 | - | |
| 19 | 19 | UserMailer.profiles_suggestions_email(person).deliver |
| 20 | 20 | rescue Exception => exception |
| 21 | - Rails.logger.warn("Error with suggestions for person ID %d\n%s" % [person_id, exception.to_s]) | |
| 21 | + logger.warn("Error with suggestions for person ID %d: %s" % [person_id, exception.to_s]) | |
| 22 | 22 | end |
| 23 | 23 | end |
| 24 | 24 | ... | ... |