<commit_before>class StepByStepScheduledPublishWorker
  include Sidekiq::Worker
  sidekiq_options retry: 5

  def perform(id)
    step_nav = nil

    StepByStepPage.transaction do
      step_nav = StepByStepPage.lock.find_by(id: id)
      StepNavPublisher.publish(step_nav)
      step_nav.mark_as_published
    end
  end
end<commit_msg>Report publishing error to Sentry<commit_after>class StepByStepScheduledPublishWorker
  include Sidekiq::Worker
  sidekiq_options retry: 5

  sidekiq_retries_exhausted do |msg, _e|
    GovukError.notify(msg['error_message'])
  end

  def perform(id)
    step_nav = nil

    StepByStepPage.transaction do
      step_nav = StepByStepPage.lock.find_by(id: id)
      StepNavPublisher.publish(step_nav)
      step_nav.mark_as_published
    end
  end
end
{'fraction_non_alphanumeric': 0.06377551020408163, 'fraction_numerical': 0.002551020408163265, 'mean_word_length': 4.064516129032258, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6714973', 'n_tokens_mistral': 274, 'n_tokens_neox': 262, 'n_words': 51}