Skip to content

Commit 0f6ac56

Browse files
committed
Ensure a single error log line
1 parent c55a71d commit 0f6ac56

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

app/jobs/publish_feed_job.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ def publish_rss(podcast, feed)
5050
end
5151

5252
def fail_state(podcast, type, error)
53-
method = case type
54-
when "apple" then :error_apple!
55-
when "rss" then :error_rss!
56-
when "apple_timeout", "error" then :error!
53+
(method, level) = case type
54+
when "apple" then [:error_apple!, :warn]
55+
when "rss" then [:error_rss!, :warn]
56+
when "apple_timeout", "error" then [:error!, :error]
5757
end
5858

5959
PublishingPipelineState.public_send(method, podcast)
60-
Rails.logger.error(error.message, {podcast_id: podcast.id, error_type: type})
60+
Rails.logger.send(level, error.message, {podcast_id: podcast.id})
6161
raise error
6262
end
6363

0 commit comments

Comments
 (0)