<commit_before>require 'prx_access'

class StoryUpdateJob < ActiveJob::Base
  include Announce::Subscriber
  include PRXAccess

  queue_as :feeder_default

  subscribe_to :story, [:create, :update, :delete, :publish, :unpublish]

  attr_accessor :body, :episode, :podcast, :story

  def perform(*args)
    ActiveRecord::Base.connection_pool.with_connection do
      super
    end
  end

  def receive_story_update(data)
    # don't allow invalid episodes to update or publish
    return if ['update', 'publish'].include?(action) && data[:status] != 'complete'

    load_resources(data)
    episode ? update_episode : create_episode
    episode.try(:copy_media)
    podcast.try(:publish!)
  end
<commit_msg>add create to ignored actions<commit_after>require 'prx_access'

class StoryUpdateJob < ActiveJob::Base
  include Announce::Subscriber
  include PRXAccess

  queue_as :feeder_default

  subscribe_to :story, [:create, :update, :delete, :publish, :unpublish]

  attr_accessor :body, :episode, :podcast, :story

  def perform(*args)
    ActiveRecord::Base.connection_pool.with_connection do
      super
    end
  end

  def receive_story_update(data)
    # don't allow invalid episodes to update or publish
    return if ['create', 'update', 'publish'].include?(action) && data[:status] != 'complete'

    load_resources(data)
    episode ? update_episode : create_episode
    episode.try(:copy_media)
    podcast.try(:publish!)
  end

{'fraction_non_alphanumeric': 0.10639777468706536, 'fraction_numerical': 0.0, 'mean_word_length': 4.5346153846153845, 'pattern_counts': {'":': 0, '<': 5, '<?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': '897131', 'n_tokens_mistral': 458, 'n_tokens_neox': 443, 'n_words': 111}