Skip to content

Commit

Permalink
Merge pull request #731 from PRX/more-logging-for-publishing
Browse files Browse the repository at this point in the history
More logging for publishing
  • Loading branch information
svevang authored Aug 2, 2023
2 parents 0617dd6 + 09af0d9 commit 86c67e5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions app/models/episode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class Episode < ApplicationRecord
def self.release_episodes!(_options = {})
podcasts = []
episodes_to_release.each do |e|
Rails.logger.info("Releasing episode", podcast_id: e.podcast_id, episode_id: e.id)
podcasts << e.podcast
e.touch
end
Expand Down
7 changes: 4 additions & 3 deletions app/models/podcast.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ def self.by_prx_series(series)
end

def self.release!(options = {})
Rails.logger.info("Podcast.release! called")
PublishingPipelineState.expire_pipelines!
Episode.release_episodes!(options)
Rails.logger.tagged("Podcast.release!") do
PublishingPipelineState.expire_pipelines!
Episode.release_episodes!(options)
end
end

def set_defaults
Expand Down
2 changes: 1 addition & 1 deletion app/models/publishing_pipeline_state.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def self.most_recent_state(podcast)
end

def self.start_pipeline!(podcast)
Rails.logger.tagged("PublishingPipeLineState.start_pipeline!") do
Rails.logger.tagged("PublishingPipeLineState.start_pipeline!", "Podcast:#{podcast.id}") do
PublishingQueueItem.ensure_queued!(podcast)
attempt!(podcast)
end
Expand Down

0 comments on commit 86c67e5

Please sign in to comment.