Skip to content

Commit

Permalink
Ensure a single error log line
Browse files Browse the repository at this point in the history
  • Loading branch information
svevang committed Oct 31, 2024
1 parent c55a71d commit 0f6ac56
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/jobs/publish_feed_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ def publish_rss(podcast, feed)
end

def fail_state(podcast, type, error)
method = case type
when "apple" then :error_apple!
when "rss" then :error_rss!
when "apple_timeout", "error" then :error!
(method, level) = case type
when "apple" then [:error_apple!, :warn]
when "rss" then [:error_rss!, :warn]
when "apple_timeout", "error" then [:error!, :error]
end

PublishingPipelineState.public_send(method, podcast)
Rails.logger.error(error.message, {podcast_id: podcast.id, error_type: type})
Rails.logger.send(level, error.message, {podcast_id: podcast.id})
raise error
end

Expand Down

0 comments on commit 0f6ac56

Please sign in to comment.